📄 050-052.html
字号:
<HTML>
<HEAD>
<META name=vsisbn content="0849398010">
<META name=vstitle content="Industrial Applications of Genetic Algorithms">
<META name=vsauthor content="Charles Karr; L. Michael Freeman">
<META name=vsimprint content="CRC Press">
<META name=vspublisher content="CRC Press LLC">
<META name=vspubdate content="12/01/98">
<META name=vscategory content="Web and Software Development: Artificial Intelligence: Other">
<TITLE>Industrial Applications of Genetic Algorithms:Software Test Data Generation from a Genetic Algorithm</TITLE>
<!-- HEADER -->
<STYLE type="text/css">
<!--
A:hover {
color : Red;
}
-->
</STYLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<!--ISBN=0849398010//-->
<!--TITLE=Industrial Applications of Genetic Algorithms//-->
<!--AUTHOR=Charles Karr//-->
<!--AUTHOR=L. Michael Freeman//-->
<!--PUBLISHER=CRC Press LLC//-->
<!--IMPRINT=CRC Press//-->
<!--CHAPTER=4//-->
<!--PAGES=050-052//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="049-050.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="052-054.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P><FONT SIZE="+1"><B>UNIT TESTING</B></FONT></P>
<P>Testing occurs at many steps in the software development lifecycle. The purpose of testing is to identify program flaws. Software is typically broken down into numerous modules, functions or subroutines. The process of testing these individual portions of a program is termed unit testing. Other forms of testing occur throughout the development process. In addition to testing individual software modules, testing also takes place during module integration, at the box and system level, and during field trials. This chapter addresses the production of test data for testing at the software unit or module level. Performing the test reaffirms the module’s adherence to the requirements and helps uncover flaws. Test plans written for individual software modules are called unit test plans and consist of multiple calls passing input data to the module under test (MUT). For each set of input data, the test plan indicates what the module’s response should be. Unit test plans are typically generated manually by the developer when designing a new module.
</P>
<P>Some of the more popular unit testing techniques are equivalence partitioning, structural testing, constraint based testing, and functional testing. Module testing without detailed knowledge of the source code is called black box testing. Black box testing proceeds with the tester being provided no more than a description of the module under test and allowed parameter values. White box (or structural testing) depends on the tester having source code available to help identify test data likely to draw out design flaws. Functional testing and equivalence partitioning are black box testing techniques. Structural and constraint based testing are white box testing techniques. The generation of test data is a fundamental problem of all testing techniques.</P>
<P>In general, any form of software testing tries to limit the number of test cases run. It is simply not economical (or even feasible) to run through all possible permutations of program control and data flow because the number of possible paths or threads of execution through a module can quickly become unmanageable. Structural testing attempts to execute a set of test cases which evaluates every line of code at least once, comparing the results to those expected.</P>
<P>The goal of the current effort is twofold: (1) to investigate the applicability of genetic algorithms to automate unit test data generation, and (2) to identify factors which improve the performance of the genetic algorithm in generating test data. This is the first step in designing a utility to automatically generate unit test data.</P>
<P>Much work remains in the development of this utility. A C language parser is needed to analyze and instrument the source code and then set up the genetic algorithm. The utility would be invoked by adding a new .ut rule to a development project’s Makefile. The Unix make utility would instruct the parser to analyze and instrument a copy of the indicated source code file. The parser would then tailor the genetic algorithm’s source code to the module under test. The instrumented copy of the module under test and the genetic algorithm’s source code would then be compiled and executed to produce a list of test data.</P>
<P>If the MUT included a description of its software requirements, delimited by a special token the parser was designed to detect, the requirements could be extracted and saved by the parser. A suitable test plan could then be constructed by concatenating the saved requirements and driver code calling the module under test with the newly produced test data. The tester is responsible for verifying that actual performance matches the listed requirements. As described, such a utility would produce unit test data on demand and provide the following benefits:</P>
<DL>
<DD><B>•</B> Eliminate the need for the storage and maintenance of unit test plans
<DD><B>•</B> Reduce cycle time by automating the production of test data
<DD><B>•</B> Eliminate traceability problems when multiple versions of a source module exist
</DL>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="049-050.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="052-054.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<hr width="90%" size="1" noshade>
<div align="center">
<font face="Verdana,sans-serif" size="1">Copyright © <a href="/reference/crc00001.html">CRC Press LLC</a></font>
</div>
<!-- all of the reference materials (books) have the footer and subfoot reveresed -->
<!-- reference_subfoot = footer -->
<!-- reference_footer = subfoot -->
</BODY>
</HTML>
<!-- END FOOTER -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -