Software design and testing

来源:互联网 发布:淘宝怎么买伟哥 编辑:程序博客网 时间:2024/05/22 05:08

keywords:
software design 软件设计
flowchart 流程图
design description language 设计描述语言
programming system 程序设计系统
file structure 文件结构
software testing 软件测试
coding 编码
data flow diagram 数据流程图
case 案例
algorithm 算法
data structure 数据结构
module testing 模块测试
unit testing 单元测试
boundary condition 边界条件
integration testing 综合测试
function test 功能测试
performance test 性能测试
debugging 调试 排错
program module 程序模块

1.software design
Software design is a creative process,it require a certain amount of flair on the part of the designer and the final design is normally an iteration from a number of preliminary designs, Design cannot be learned from a book - it must be practiced and learnt by exprience and study of existing systems, Good design is the key to effective software engineering, A well designed software system is straightforward to implement and maintain, easily understood and reliable, Badly designed systems, although they may work, are likely to be expensive to maintain, difficult to test and unreliable, The design stage is therefore the most critival part of the software development process.

Until fairly recently, software design was largely an ad hoc process, Given a set of requirements. usually in natural language, an informal design was prepared, often in the form of a flowchart, coding then commenced and the design was modified as the system was implemented, when the implementation stage is complete, the design had usually changed so much from its inital specification that the original design document was a totally inadequate description of the system.

The approach to software design was responsible for many dramatic and very expensive project failures, now it is realized that completely informal natation sunch as flowcharts. which are close to the programming language, are inadequate vehicles for formulating and expressing system design, It is recognized that precise (although not necessarily formal) specification is an essential part of the design process and that software design is an iterative, multi-stage activity which cannot be represented in any single notation, Accordingly, a number of design notations sunch as data flow diagrams, HIPO charts, structure diagrams and design description languages have been developed. which are superior to flowcharts for expressing software designs,

Given a requirements definition, the software enginner must use this to derive the design of a programming system which satisfies these requirements. this derivation is accomplished in a number of stages.
(1)the subsystems making up the programming system must be estabilished.
(2)Each subsystem must be decomposed into separate components and the subsystem specification establisded by defining the operation of these components.
(3) each program may then be designed interms of interacting subcomponents.
(4)Each component must then be refined. This normally entails specifying each component as hierarchy of subcomponents.
(5)At some stage of this refinement process. the algorithms used in each component must be specified in detail.

As well as these various stage of programming system design, the software engineer may also be required to design communication mechanisms allowing processes in the system to communicate, He or she may have to design file structures, and will almost certainly have to design the data structures used in his programs. He or she will have to design test cases to validate his programs.

2.Softeware testing
1) Purpose of Testing
No matter how capably we write programs. it is clear from the variety of possible errors that we should check to insure that you modules are coded correctly, Many programmers view testing as a demonstration that their programs perform properly. However, the idea of demonstrating correctness is really the reverse of what testing is all about. we test a program in order to demonstrate the existence of an error, Because our goal is to discover errors. we can consider a test correction is the process of determining what causes the error and of making change to the system so that the error no longer exists.

2)stages of testing
In the development of a large system, testing involves servaral stages, first, each program modules is tested as a single program, usually isolated from the other programs in the system.sunch testing, known as module testing or unit testing, verifies that the module functions properly with types of expected from studying the module design, Unit testing is done in a contrilled enviroment whenever possible so that the test team can feed a predetermined set of data to the module being tested and observe what output data are produced, In addition, the test team checks the internal data instructures. the logic. and the boundary conditions for the input and output data.

When collections of modules have been unit-test, the next step is to insure that the interfaces among the modules are defined and handled properly, Intergration testing is the process of verifyung that the components of a system work together as described in the program design and system design specifucations.

Once we are sure that information is passed among modules according to the design prescriptions, we test the system to assure that it has the desired functionality, A function test evaluates the system to determine if the functions described by the requirements specification are actually performed by the integrateed system, The result, then, is a functioning system.

Fig 8-5. illustrates the serveral stages of testing, Although systems may differ in size, the type of testing described in each stage in necessary for assuring the proper performance of any system being developed.

原创粉丝点击