2-2 software configuration processes and tools

2-2 software configuration processes and tools

Generalized software configuration : Design ==> Programming / refactoring ==

Software configuration narrow : Validate ==> Compile ==> Link

A software configuration process

3-part structure of the language:

  1. Programming languages: C ++, Java, Python ...
  2. Modeling Language: UML, etc.
  3. Configuration Language: XML, etc.

1. programming language

Static language : You must declare the type of a variable is created when

The c language: int a = 5;

Dynamic languages : Life does not need to type when a variable is created, the program runs discretion

As in python: a = 5

Compiled language : compiling the source code to generate a machine language, machine code, and then run by the machine

Compiled languages: C / C ++, Pascal / Object Pascal

Interpreted language : source code is not directly translated into machine language, but first translated into intermediate code, and then by the interpreter to interpret the intermediate code to run.

Interpreted languages: JavaScript, VBScript, Perl, Python, Ruby, MATLAB

Compare:

Compiled language, execution speed, high efficiency; rely on the compiler, cross-platform hearing. Interpreted language, perform slow and inefficient; rely on an interpreter, cross-platform is good.

Java language has more than two types of properties: it is necessary to compile run again.

Strongly typed language : Once a variable is assigned a data type, if not through coercion, then it will always be this type of data

Weakly typed language definitions : data types can be ignored language. It strongly typed language contrary, the value of a variable can be assigned different data types

2. modeling languages ​​and tools

Modeling language is an artificial language for expressing information, knowledge or systems designed to define a consistent set of rules to visualize, reasoning, verification and communication systems. The most common modeling language is UML (Unified Modeling Language, the Unified Modeling Language). The key is to deliver conceptual modeling language model can be achieved.

Unified Modeling Language (English: Unified Modeling Language, abbreviated UML) is a non-proprietary third-generation modeling and specification language. UML is an open process for explaining, visualization, and the preparation of a build under development, object oriented, software-intensive products open system method. UML shows the list of best engineering practices, these best practices in terms of large-scale, complex systems modeling, especially in the software architecture has been validated level.

FIG class (Class Diagram) : class diagram modeling object-oriented systems is the most common and most important diagram, is basis for the definition of other figures. FIG class system is mainly used to display the classes, interfaces and one static model static structure and the relationship between them.

FIG class three basic components: a class name, property, method.

img

1. generalization, i.e. inherited (Generalization) : represents the is-a relationship, the maximum degree of coupling is a relationship between objects, subclass inherits all the details of the parent class. Directly inherited expression language. Class diagram in solid line with arrowheads represent the arrow pointing from the subclass parent class.

img

2. Implement (Realization) : the relationship between a class diagram is the interface and implementation. This is nothing to talk about. In the class diagram of the dotted line with triangular arrow, arrows pointing from the class that implements the interface.

img

3.依赖(Dependency):对象之间最弱的一种关联方式,是临时性的关联。代码中一般指由局部变量、函数参数、返回值建立的对于其他对象的调用关系。一个类调用被依赖类中的某些方法而得以完成这个类的一些职责。在类图使用带箭头的虚线表示,箭头从使用类指向被依赖的类。

img

4.关联(Association) : 对象之间一种引用关系,比如客户类与订单类之间的关系。这种关系通常使用类的属性表达。关联又分为一般关联、聚合关联与组合关联。后两种在后面分析。在类图使用带箭头的实线表示,箭头从使用类指向被关联的类。可以是单向和双向

img

4.聚合(Aggregation) : 表示has-a的关系,是一种不稳定的包含关系。较强于一般关联,有整体与局部的关系,并且没有了整体,局部也可单独存在。如公司和员工的关系,公司包含员工,但如果公司倒闭,员工依然可以换公司。在类图使用空心的菱形表示,菱形从局部指向整体。

img

5.组合(Composition) : 表示contains-a的关系,是一种强烈的包含关系。组合类负责被组合类的生命周期。是一种更强的聚合关系。部分不能脱离整体存在。如公司和部门的关系,没有了公司,部门也不能存在了;调查问卷中问题和选项的关系;订单和订单选项的关系。在类图使用实心的菱形表示,菱形从局部指向整体。

img

6.多重性(Multiplicity) : 通常在关联、聚合、组合中使用。就是代表有多少个关联对象存在。使用数字..星号(数字)表示。如下图,一个割接通知可以关联0个到N个故障单。

img

聚合和组合的区别

这两个比较难理解,重点说一下。聚合和组合的区别在于:聚合关系是“has-a”关系,组合关系是“contains-a”关系;聚合关系表示整体与部分的关系比较弱,而组合比较强;聚合关系中代表部分事物的对象与代表聚合事物的对象的生存期无关,一旦删除了聚合对象不一定就删除了代表部分事物的对象。组合中一旦删除了组合对象,同时也就删除了代表部分事物的对象。

聚合关系图:

img

组合关系图:

img

img

小结:对象之间的联系

继承 inheritance :一般与特殊的关系 is a kind of组合 composition :部分与整体的关系,彼此不可分 is part of聚合 aggregation :部分与整体的关系,但彼此可分 owns a关联 association :对象之间的长期静态联系 has a依赖 dependence :对象之间的动态的、临时的通信联系 use a类间联系的强度:继承 >>> 组合 >> 聚合 >> 关联 >>> 依赖

3.配置语言

配置程序的参数和初始设置,应用应提供工具支持配置文件的维护

如: XML, YAML, JSON

XML:可扩展标记语言 (Extensible Markup Language, XML) ,用于标记电子文件使其具有结构性的标记语言,可以用来标记数据、定义数据类型,是一种允许用户对自己的标记语言进行定义的源语言。 XML是标准通用标记语言 (SGML) 的子集,非常适合 Web 传输。XML 提供统一的方法来描述和交换独立于应用程序或供应商的结构化数据。

什么是可扩展标记语言?

  • 可扩展标记语言是一种很像超文本标记语言的标记语言。
  • 它的设计宗旨是传输数据,而不是显示数据。
  • 它的标签没有被预定义。您需要自行定义标签。
  • 它被设计为具有自我描述性。
  • 它是W3C的推荐标准。

    img

YAML是“YAML不是一种标记语言”的外语缩写 ;但为了强调这种语言以数据做为中心,而不是以置标语言为重点,而用返璞词重新命名。它是一种直观的能够被电脑识别的数据序列化格式,是一个可读性高并且容易被人类阅读,容易和脚本语言交互,用来表达资料序列的编程语言。

1560041951196

JSON(JavaScript Object Notation, JS 对象简谱) 是一种轻量级的数据交换格式。它基于 ECMAScript (欧洲计算机协会制定的js规范)的一个子集,采用完全独立于编程语言的文本格式来存储和表示数据。简洁和清晰的层次结构使得 JSON 成为理想的数据交换语言。 易于人阅读和编写,同时也易于机器解析和生成,并有效地提升网络传输效率。

1560042169440

二.代码走查

一种结构化的检查代码和文档缺陷的过程

代码静态分析:

定义:是在不执行计算机程序的条件下,对源代码进行分析,找出代码缺陷。

执行方式:一般配合静态程序分析工具进行,如CheckStyle, FindBugs, PMD for Java

可检测类型:死锁,空指针,资源泄漏,缓存区溢出,安全漏洞,竟态条件。

用途:程序翻译/编译,程序优化重构,软件缺陷检测等。

1.能够检测所有的代码级别可执行路径组合,快速,准确。

2.直接面向源码,分析多种问题。

3.在研发阶段开始找到并修复多种问题,节省大量时间,人力成本

动态调试技术

动态调试技术在软件逆向工程领域也是一个很热门的概念,他是与静态分析技术相对而言的。静态分析技术是指破解者利用反汇编工具将二进制的可执行文件翻译成汇编代码,通过对代码的分析来破解软件。而动态调试则是指破解者利用调试器跟踪软件的运行,寻求破解的路径。

代码动态调试技术,一般是通过观察程序在运行过程中的状态,如寄存器内容,函数执行结果,内存使用情况等等,分析函数功能,明确代码逻辑,挖掘可能存在的漏洞。

运行程序以分析代码;利用测试度量技术(如覆盖率)确保代码的可能功能均被充分测试到

Profiling for measuring time and space complexity of the program, the specific instruction or function call frequency or duration of

III. Debug and test (Debugging and Testing)

Test (the Test) : software to determine whether there is an error

Debug (Debug) : the error (bug) and correction process

Note: Testing and commissioning will not improve software quality, but found that the main means of defects, software quality should be ensured by careful analysis of demand, well-designed, high-quality encoding.

IV. Reconstruction (Refactoring)

Reconstruction code does not change under the premise of external behavior, improving its internal structure.

V. Compile

For Java: – Make – Ant – Maven – Gradle – Eclipse

Guess you like

Origin www.cnblogs.com/lee3258/p/11994069.html