Software errors: prevention and detection.Most programmers are rather cavalier cavalier (kăv'əlĭr`), in general, an armed horseman. In the English civil war the supporters of Charles I were called Cavaliers in contradistinction to the Roundheads, the followers of Parliament. about controlling the quality of the software they write. They bang out some code, run it through some fairly obvious ad hoc For this purpose. Meaning "to this" in Latin, it refers to dealing with special situations as they occur rather than functions that are repeated on a regular basis. See ad hoc query and ad hoc mode. tests, and if it seems okay, they're done. While this approach may work for small, personal programs, it is not suitable for professional software development. Modern software engineering practices include considerable effort directed toward software quality assurance and testing. The idea, of course, is to produce completed software systems that have a high probability of satisfying the customer's needs. There are two ways to deliver software free of errors. The first is to prevent the introduction of errors in the first place. And the second is to identify the bugs lurking See lurk. (messaging, jargon) lurking - The activity of one of the "silent majority" in a electronic forum such as Usenet; posting occasionally or not at all but reading the group's postings regularly. in your code, seek them out, and destroy them. Obviously, the first method is superior. A big part of software quality comes from doing a good job of defining the requirements for the system you're building and designing a software solution that will satisfy those requirements. Testing concentrates on detecting those errors that creep in Verb 1. creep in - enter surreptitiously; "He sneaked in under cover of darkness"; "In this essay, the author's personal feelings creep in" sneak in penetrate, perforate - pass into or through, often by overcoming resistance; "The bullet penetrated her chest" despite your best efforts to keep them out. In this feature we take a look at why the issue of software quality should be on the tip of your brain whenever you're programming, as well as discussing some tried-and-true methods for building high-quality software systems. Then we'll explore the strategies and tactics of software testing Software testing is the process used to measure the quality of developed computer software. Usually, quality is constrained to such topics as correctness, completeness, security, but can also include more technical requirements as described under the ISO standard ISO 9126, such . Why Worry About Software Quality? A computer hobbyist doesn't think much about software quality. We write some little programs, experiment with graphics tricks, delve into the operating system operating system (OS) Software that controls the operation of a computer, directs the input and output of data, keeps track of files, and controls the processing of computer programs. , and try to learn how the beast works. On occasion we write something useful, but mostly just for own benefit. The 'quality' of one-user, short-lived programs like these doesn't really matter much, since they're not for public consumption. The professional software engineer developing commercial products or systems for use by his employer has, however, a more serious problem. Besides the initial effort of writing the program, he has to worry about software maintenance. "Maintenance' is everything that happens to a program after you thought it was done. In the real world, software maintenance is a major issue. Industry estimates indicate that maintenance can consume up to 80 percent of a software organization's time and energy. As a great example of the importance of software maintenance, consider how many versions of the Macintosh operating system (operating system) Macintosh Operating System - (Mac OS) Apple Computer, Inc.'s proprietary operating system for their Macintosh family of personal computers. The part of the operating system that simulates the desktop is called "Finder. have existed prior to version 7.0. Each new system version was built upon the previous one, probably by changing some existing code modules, throwing out obsolete modules, and splicing splicing /splic·ing/ (spli´sing) 1. the attachment of individual DNA molecules to each other, as in the production of chimeric genes. 2. RNA s. in new ones. The chore of maintenance is greatly facilitated if the software being changed is well-structured, well-documented, and well-behaved. More often, however, code is written rather sloppily slop·py adj. slop·pi·er, slop·pi·est 1. Marked by a lack of neatness or order; untidy: a sloppy room. 2. and is badly structured. Over time, such code becomes such a tangle of patches and fixes that eventually you're better off rewriting re·write v. re·wrote , re·writ·ten , re·writ·ing, re·writes v.tr. 1. To write again, especially in a different or improved form; revise. 2. the whole module, rather than trying to fix it once again. High-quality software is designed to survive a lifetime of changes. What is Software Quality? Roger Pressman, a noted software engineering author and consultant, defines software quality like this: Conformance con·for·mance n. Conformity. Noun 1. conformance - correspondence in form or appearance conformity agreement, correspondence - compatibility of observations; "there was no agreement between theory and to explicitly stated functional and performance requirements, explicitly documented development standards, and implicit characteristics that are expected of all professionally developed software. A shorter definition is that a high-quality software system is one that's delivered to the users on time, costs no more than was projected, and, most importantly Adv. 1. most importantly - above and beyond all other consideration; "above all, you must be independent" above all, most especially , works properly. 'Working properly' implies that the software must be as nearly bug-free as possible. While these are workable definitions, they are not all-inclusive. For example, if you build a software system that conforms precisely to a set of really lousy lous·y adj. lous·i·er, lous·i·est 1. Infested with lice. 2. Extremely contemptible; nasty: a lousy trick. 3. specifications, do you have a high-quality product? Probably not. Part of our job as software developers is to help ensure that the system specs (SPECificationS) The details of the components built into a device. See specification. themselves are of high quality (i.e., that the specs properly address the user's needs), as well as building an application that conforms to this spec. Other important points are implied in this definition. One is that you HAVE specifications for the programs you're writing. Too often, we work from a fuzzy fuzz·y adj. fuzz·i·er, fuzz·i·est 1. Covered with fuzz. 2. Of or resembling fuzz. 3. Not clear; indistinct: a fuzzy recollection of past events. 4. notion of what we're trying to do. This fuzzy image becomes refined over time, but if you've been writing code during that time, you'll probably find that much of it has to be changed or thrown out. Wouldn't you rather think the problem through in detail up front, and only code it once? I've discovered through years of practice that this approach results in a much better product than if I just banged out the code on the fly. Another implication is that 'software' includes more than executable code Software in a form that can be run in the computer. It typically refers to machine language, which is comprised of native instructions the computer carries out in hardware. Executable files in the DOS/Windows world use .EXE and . . The 'deliverables" from a software development project also include the written specifications, system designs, test plans, source code documentation, and user manuals. Specifications and designs might include narrative descriptions of the program requirements and structure, graphical models In probability theory, statistics, and machine learning, a graphical model (GM) is a graph that represents independencies among random variables by a graph in which each node is a random variable, and the missing edges between the nodes represent conditional independencies. of the system (such as data flow diagrams A description of data and the manual and machine processing performed on the data as it moves and changes from one stage to the next. It also includes the locations where the data are placed in permanent storage (disk, tape, etc.). ), and process specs for the modules in your system. Software quality impacts these other system deliverables just as it affects the source code. The quality of documentation is particularly important. Have you ever tried to change someone else's code without being able to understand his mindset mind·set or mind-set n. 1. A fixed mental attitude or disposition that predetermines a person's responses to and interpretations of situations. 2. An inclination or a habit. at the time he wrote it? Detailed documentation about the parts of the software system, the logic behind them, and how they fit together is extremely important. But erroneous erroneous adj. 1) in error, wrong. 2) not according to established law, particularly in a legal decision or court ruling. documentation is worse than nothing at all, since it can lead you down a blind alley blind alley n. 1. An alley or passage that is closed at one end. 2. A mistaken, unproductive undertaking. blind alley Noun 1. an alley open at one end only 2. . Any time the documentation and source code don't agree, which do you believe? There's a compelling economic incentive for building quality into software. The true cost of a software development project is the base cost (what you spend to build the system initially) PLUS the rework re·work tr.v. re·worked, re·work·ing, re·works 1. To work over again; revise. 2. To subject to a repeated or new process. n. cost (what you spend to fix the errors in the system). The rework cost rarely is figured into either the time or money budgets, with the consequence that many projects cost much more to complete than expected and soak up still more money as work is done to make the system truly conform to Verb 1. conform to - satisfy a condition or restriction; "Does this paper meet the requirements for the degree?" fit, meet coordinate - be co-ordinated; "These activities coordinate well" the specifications. In too many cases, the project is delivered too late to be useful, or not at all. Software Quality Assurance Software quality assurance, or SQA SQA Scottish Qualifications Authority SQA Software Quality Assurance SQA Supplier Quality Assurance SQA Society of Quality Assurance SQA Singapore Airlines SQA Sperm Quality Analyzer SQA System Quality Assurance SQA Statistical Quality Analysis , is the subfield sub·field n. 1. A subdivision of a field of study; a subdiscipline. 2. Mathematics A field that is a subset of another field. of software engineering devoted to seeing that the deliverables from a development project meet acceptable standards of completeness and quality. The overall goal of SQA is to lower the cost of fixing problems by detecting errors early in the development cycle. And if your SQA efforts prevent some errors from sneaking into your code in the first place, so much the better. SQA is a watchdog function looking over the other activities involved in software development. Here are some important SQA thoughts. First, you can't test quality into a product; you have to build it in. Testing can only reveal the presence of defects in the product. Second, software quality assurance is not a task that's performed at one particular stage of the development life cycle, and most emphatically em·phat·ic adj. 1. Expressed or performed with emphasis: responded with an emphatic "no." 2. Forceful and definite in expression or action. 3. not at the very end. Rather, SQA permeates the entire development process, as we'll see shortly. Third, SQA is best performed by people not directly involved in the development effort. The responsibility of the SQA effort is to the customer, to make sure that the best possible product is delivered, rather than to the software developers or their management. SQA won't succeed if it just tells the managers what they want to hear. Testing is certainly a big part of SQA, but by no means the only part. Testing, of course, is the process of executing a computer program with the specific intention of finding errors in it. It's nearly impossible to prove that a program is correct, so instead we do our best to make it fail. Unfortunately, most of us perform testing quite casually, without a real plan and without keeping any records of how the tests went. Proper software testing requires a plan, or test script The instructions in a test program. It defines the actions and pass/fail criteria. For example, if the action is "to enter a valid account number," the expected result is that the data are accepted. Entering an invalid number should yield a particular error message. See test case. . It includes documentation, sample input datasets, and records of test results. Instead of being informal and ad hoc, good software testing is a systematic, reproducible effort with well-defined expectations. We'll talk more about good testing strategies later on. Now let's look at some goals of SQA for the various stages of structured software development. No matter what software development life cycle model you follow, you'll always have to contend with requirements analysis (project) requirements analysis - The process of reviewing a business's processes to determine the business needs and functional requirements that a system must meet. , system specification, system design, code implementation, testing, and maintenance, so these SQA goals are almost universally applicable. For one-man projects, much of the formality formality, in chemistry: see chemical equilibrium; concentration. of these stated SQA goals is not needed. Instead, try to discipline yourself enough to meet the most important aspects of the goals, while still having fun writing the programs. Requirements Analysis Ensure that the system requested by the customer is feasible (many large projects have a separate feasibility study The analysis of a problem to determine if it can be solved effectively. The operational (will it work?), economical (costs and benefits) and technical (can it be built?) aspects are part of the study. Results of the study determine whether the solution should be implemented. phase even before gathering formal requirements). * Ensure that the requirements specified by the customer will in fact satisfy his real needs, by recognizing requirements that are mutually incompatible, inconsistent, ambiguous, or unnecessary. Sometimes needs can be addressed in better ways than those the user is requesting. * Give the customer a good idea of what kind of software system will actually be built to address his stated requirements. Simple prototypes often are useful for this. * Avoid misunderstandings between developers and customers, which can lead to untold grief and hassles farther down the road. Software Specifications Ensure that the specifications are consistent with the system requirements To be used efficiently, all computer software needs certain hardware components or other software resources to be present on a computer system. These pre-requisites are known as (computer) system requirements and are often used as a guideline as opposed to an absolute rule. , by setting up a requirements traceability Overview Traceability as a general term is the "ability to chronologically interrelate the uniquely identifiable entities in a way that matters." The word chronology document. This document lists the various requirements, and then tracks how they are addressed in the written specs, the system design (which data flow process addresses the requirement), and the code (which function or subroutine A group of instructions that perform a specific task. A large subroutine might be called a "module" or "procedure." Subroutine is somewhat of a dated term, but it is still quite valid. satisfies the requirement). * Ensure that specifications have been supplied for system flexibility, maintainability, and performance where appropriate. * Ensure that a testing strategy has been established. * Ensure that a realistic development schedule has been established, including scheduled reviews. * Ensure that a formal change procedure has been devised for the system. Uncontrolled changes, resulting in many sequential (or even concurrent) versions of a system, can really contribute to quality degradation. Design * Ensure that standards have been established for depicting designs (such as data flow diagram models for process-oriented systems, or entity- relationship models for data-oriented systems), and that the standards are being followed. * Ensure that changes made to the designs are properly controlled and documented. * Ensure that coding doesn't begin until the system design components have been approved according to according to prep. 1. As stated or indicated by; on the authority of: according to historians. 2. In keeping with: according to instructions. 3. agreed-upon criteria. Of course, we all do some coding before we really 'should"; so long as you think of it as "prototyping", that's fine. Just don't get carried away prematurely. * Ensure that design reviews proceed as scheduled. Coding Ensure that the code follows established standards of style, structure, and documentation. Even though languages like C let you be super-compact and hence super- obscure in your coding, don't forget that a human being (maybe even you) may have to work with that code again some day. Clarity of code is usually preferred over conciseness. * Ensure that the code is being properly tested and integrated, and that revisions made in coded modules are properly identified. * See that code writing is following the stated schedule. It probably won't be; the customer is entitled en·ti·tle tr.v. en·ti·tled, en·ti·tling, en·ti·tles 1. To give a name or title to. 2. To furnish with a right or claim to something: to know this and to know the impact on delivery time. * Ensure that code reviews are being held as scheduled. Testing * Ensure that test plans have been created and that they are being followed. This includes a library of test data, driver programs to run through the test data, and documentation of the results of each formal test that has been performed. * Ensure that the test plans that are created do in fact address all of the system specifications. * Ensure that, after testing and reworking, the software does indeed conform to the specifications. Maintenance * Ensure consistency of code and documentation. This is quite difficult; we tend to not update documentation when we change the programs. However, such an oversight can create nightmares the next time a change has to be made. Can you trust the docs, or not? * Ensure that the established change control process is being observed, including procedures for integrating changes into the production version of the software (configuration control). * Ensure that changes made in the code follow the coding standard, are reviewed, and do not cause the overall code structure to deteriorate de·te·ri·o·rate v. 1. To grow worse in function or condition. 2. To weaken or disintegrate. . By now you're saying, 'Yeah, right. No way, man. Can't be done." To be honest, most professional software engineers DONT DONT Disturbing Opponents' No Trump DONT Disturb Opponents' NoTrump (Bridge game) DONT Double Openers No-Trump (bridge bidding system) follow nearly this stringent a quality plan. Unfortunately, the result of having no SQA plan at all often is software of low, perhaps unacceptable, quality. If you can incorporate even a few of these SQA goals into your own development activity, you should see some real improvements. I certainly have. Making SQA Happen There are three principal SQA activities: 1. The creation and enforcement of standards, practices, and conventions. 2. Conducting and keeping records on project reviews. 3. Independent test case design and execution (independent of the guy writing the code, that is). I'll assume that you're already practitioners of standard methods for high-quality software system design. By this I mean that you've selected methods and tools that suit your needs for structured analysis and design, such as data flow diagrams, data dictionaries A database about data and databases. It holds the name, type, range of values, source, and authorization for access for each data element in the organization's files and databases. , and process specifications. And of course I assume that you all practice good structured programming techniques. We'll spend some time on software testing methods later on this article. Now let's look at the powerful tool of reviews, or walkthroughs. Reviews Many software engineering authorities believe that the single most effective SQA activity is to hold structured reviews or walkthroughs at key stages of the development process. The review process involves collecting several pairs of skilled eyes, besides those of the developer, into a room and scrutinizing the deliverables from a particular phase of system development The purpose of the review is to find errors. It has the additional benefit of educating your associates about your project, which can be valuable if the members of a software development group ever have to do maintenance on systems they didn't build (the usual real-world case). I like to schedule reviews or walkthroughs at these points during development: after the requirements specification has been completed; after overview design is complete (usually a data flow model); after detail design is complete (process specifications for individual modules); after the test plan is written; and after coding has been done. I always include the primary customer representative ("project champion') in the requirements and overview design reviews. The specific topics covered during an SQA review depend on the nature of the deliverables produced. For example, you'll do things a little differently if your specification document is a written narrative or if it includes a data flow model of the problem being addressed. Reviews of specifications and overview designs should examine data flow diagrams and data models for consistency, proper balancing between levels, and accuracy and completeness of the data dictionary. During the detail design review, structure charts and process specs are examined for errors and inconsistencies. Along the way, make sure that all of the requirements from the specification phase are being satisfied. A code review checks for the presence of all the features described in the process specification for the module being studied. Again, you should look for inconsistencies with the data dictionary and other design documents. The code should be checked for quality of structure, documentation, completeness, complexity, and clarity. Look for the characteristics of well- structured modules, with high cohesion cohesion: see adhesion and cohesion. Cohesion (physics) The tendency of atoms or molecules to coalesce into extended condensed states. This tendency is practically universal. (performing a single task) and low coupling to other modules. Each step of the review should check all deliverables against the formal standards you agreed upon Adj. 1. agreed upon - constituted or contracted by stipulation or agreement; "stipulatory obligations" stipulatory noncontroversial, uncontroversial - not likely to arouse controversy at the outset of the project. This includes system and code-level documentation. It doesn't matter so much exactly what standards you've selected, so long as your development products adhere to adhere to verb 1. follow, keep, maintain, respect, observe, be true, fulfil, obey, heed, keep to, abide by, be loyal, mind, be constant, be faithful 2. them. Consistency is much more important than dogma DOGMA, civil law. This word is used in the first chapter, first section, of the second Novel, and signifies an ordinance of the senate. See also Dig. 27, 1, 6. here. Test Case Design Let's turn our attention to software testing techniques. Testing is the second level of error control: detection. Don't confuse testing with debugging (programming) debugging - The process of attempting to determine the cause of the symptoms of malfunctions in a program or other system. These symptoms may be detected during testing or use by real users. , which is the third step in error control. The goal is to find the problems, not necessarily to resolve them at this time. Historically, testing has occupied the greatest fraction of the time and effort associated with software development. A big reason for this is the lack of attention traditionally paid to system specification and design. Of course, you could test any program until doomsday and still not be completely sure that it will work right 1000/o of the time. But if we use thorough, structured test procedures, we can have more confidence that we've eradicated most of the bugs from the final product. The testing process begins with development of a testing plan. In principle, this can be done by either the software developer (you), or by an independent testing person or group. The difference is that the developer has a conflict of interest: he wants to demonstrate that the program works properly, while the independent tester wants to find the flaws in the software. The best compromise is to have the developer handle unit testing (testing) unit testing - The type of testing where a developer (usually the one who wrote the code) proves that a code module (the "unit") meets its requirements. and have somebody else address integration and acceptance testing (programming) acceptance testing - Formal testing conducted to determine whether a system satisfies its acceptance criteria and thus whether the customer should accept the system. . We'll talk more about these different test phases shortly. The bulk of the test script should be written prior to the coding phase. This may seem silly to you, but I've found it to work very well. One of the hardest aspects of software development is for the system designer to share the customer's vision of what the end product will be, and do. The person who writes the test script has to visualize how the software is to behave whenever a particular set of inputs is received or a particular action specified. This rigorous thought process helps greatly to uncover any fuzziness fuzz·y adj. fuzz·i·er, fuzz·i·est 1. Covered with fuzz. 2. Of or resembling fuzz. 3. Not clear; indistinct: a fuzzy recollection of past events. 4. or errors in the design plan. It also helps to catch any oversights in going from system specification to system design. Once when I was writing a test plan, I couldn't remember writing the process narratives that would implement two functions I needed to test. Sure enough, I had overlooked those requirements. The test plan helped me catch my errors and correct them very early in the system development effort. Your test script should include a bunch of individual tests that specify particular input values and action selections, and the expected results of the program execution under those conditions. Specify values for inputs that cover these situations: the smallest and largest allowable numbers; missing entries; values out of the legal range; random legitimate values; and incorrect data types. Design test paths that will ensure that each statement in the code is executed at least once. Make sure that your error-handling routines work right, and that your validation of input data catches all the sorts of errors that might realistically be encountered. Similarly, devise tests for logical control flow constructs (IF/ELSE IF/ELSE, CASE/SELECT, etc.) to make sure that each conditional branching In programming, an instruction that directs the computer to another part of the program based on the results of a compare. In the following (simulated) assembly language example, the second line is the conditional branch. statement is executed at least once in every possible direction. You can't possibly cover every possible combination of paths through even a very small program, but you should convince yourself that control is transferred properly in each individual branching statement. Loops should be tested with conditions that will produce 0, 1, and the maximum possible number of iterations, as well as a typical number of iterations in between the extremes. The fundamental purpose of writing a test plan is to be able to reproducibly run your software through a wringer wring·er n. One that wrings, especially a device in which laundry is pressed between rollers to extract water. Idiom: put (someone) through the wringer Slang To subject to a severe trial or ordeal. and see how it performs. The task of executing all these tests is simplified if you can build a library of test data files and sample output for comparison. Anything you can do to automate the testing process will save time and avoid human errors. This can be difficult with programs having a strong emphasis on user interface. One possibility is to use a tool to capture keystrokes and mouse clicks and build a library of macros that simulate specific sequences of human activities. Testing Strategies We can think of two different aspects to testing a piece of software. First, does the software properly perform its intended functions? And second, is the structure of the code free of syntax and logic errors? This is the dichotomy di·chot·o·my n. pl. di·chot·o·mies 1. Division into two usually contradictory parts or opinions: "the dichotomy of the one and the many" Louis Auchincloss. of 'functional' versus "structural' testing. The customer is concerned with the first case; he doesn't care what the code looks like, so long as it does the job. He thinks of the program as a black box: he supplies the inputs, and by some magical process he gets the desired outputs back. The developer is concerned about the structure and flow of his code; to test it properly, he must study the code and devise tests in accordance with the way the program is written. These two aspects of software testing are called "black box' and 'white box" testing, respectively. White box testing Also "glass box testing" and "clear box testing." Testing software with the knowledge of the internal structure and coding inside the program. Contrast with black box testing and gray box testing. See testing types. See also white box. typically is performed by the developer. It is a unit- or module-level testing process, in which tests are devised to evaluate the program logic and internal control flow of each individual subroutine or function in the system. Black box testing Testing software based on output requirements and without any knowledge of the internal structure or coding in the program. Contrast with white box testing and gray box testing. See testing types. See also black box. is performed by the independent testers we discussed earlier, as well as by the customers. Black box testing focuses on the proper handling of supplied inputs to generate the expected outputs. If you review the topics that I suggested your test script should include, you'll see a mix of structural and functional aspects described. The customer is the ultimate judge of whether the software meets his stated requirements. But it's the developer's responsibility to guarantee that the code is properly written so as to trap errors, handle both valid and invalid input data, and transfer control properly. System Integration and Integration Testing (testing) integration testing - A type of testing in which software and/or hardware components are combined and tested to confirm that they interact according to their requirements. Integration testing can continue progressively until the entire system has been integrated. Let's assume you're working on a software project with a few dozen separate modules. Your unit-level testing has convinced you that they are all well-behaved and properly coded. Your next problem is to assemble all these modules together into the final system, in accordance with the program architecture you devised during system design. There are basically two ways to approach the process of system integration and integration testing. You can pull the modules all together in one fell swoop swoop v. swooped, swoop·ing, swoops v.intr. 1. To move in a sudden sweep: The bird swooped down on its prey. 2. , cross your fingers, and offer sacrifices to the compiler compiler Computer software that translates (compiles) source code written in a high-level language (e.g., C++) into a set of machine-language instructions that can be understood by a digital computer's CPU. gods. This is called 'big-bang" integration, and it's almost guaranteed to fail. Or, you can use an incremental Additional or increased growth, bulk, quantity, number, or value; enlarged. Incremental cost is additional or increased cost of an item or service apart from its actual cost. approach of joining modules into small clusters and testing the clusters as you go. This technique is superior, and it will cost you much less money for aspirin aspirin, acetyl derivative of salicylic acid (see salicylate) that is used to lower fever, relieve pain, reduce inflammation, and thin the blood. Common conditions treated with aspirin include headache, muscle and joint pain, and the inflammation caused by rheumatic . The incremental integration approach can use either a top-down or a bottom-up method, although in practice a combined "sandwich" method often works best. With a top-down strategy, you begin with the highest-level control modules and add one lower-level module at a time. After each module is added, you perform appropriate tests to see that the fusion went properly. The most likely source of errors is in the data interface between each pair of modules. The bottom-up technique begins by clustering your lowest-level modules (where the real work gets done) together, testing the clusters for proper behavior, and working your way up until the whole functional processing cluster is joined to the high-level control modules. The problem with any integration strategy is that you need to simulate the presence of certain modules before you've actually incorporated them. With top-down integration, you must simulate the presence of low-level modules by using 'stub' modules. These stubs stubs The shares of equity in a firm that is financed almost completely with debt. Stubs are often created when firms go through a leveraged buyout or pay big cash dividends in order to fend off a takeover. are replaced one at a time by their actual counterparts. The stubs must have a certain amount of functionality built in so that they can fake out the higher-level modules into thinking that they are the real thing. Stubs can show simple trace messages to indicate when control is properly passed into the lower-level module, and they can display any passed parameters to demonstrate whether the data interface is functioning correctly. Stubs may also have to return some data, either real or simulated, to the calling module to allow execution of the cluster you're now testing to continue. Similarly, the clusters you're testing in a bottom-up approach aren't designed to function without the higher-level modules attached, so you have to use temporary 'driver' modules to get the program to execute. The drivers can simply invoke To activate a program, routine, function or process. the top-level module in the cluster you're now testing, or it can pass in some parameters both to test the data interface and to allow the cluster to do its thing and return some results to the driver. Neither top-down nor bottom-up integration is perfect, so you may want to select some combination strategy for your individual projects. The method you choose may be based on where you expect to have the most problems. If control is complex and processing simple, top-down offers the advantage of testing the control modules first. If the data interface between your system and the outside environment is a big issue, bottom-up may be the best approach. In general, drivers are more complex than stubs, so you may have to do a little more work if you use a straight bottom-up method. Testing isn't complete just because you think you've integrated all your modules properly. It's very important to perform an overall system test to look for additional errors that didn't crop up during the unit testing or integration process. Also, acceptance testing by the users is essential to see if the final product does in fact match the stated requirements. For more discussion about these and other aspects of software testing, see the books listed in the references. The Bottom Line The overall message from this article is that software quality is a vitally important issue in modern software development, and that there are well-defined methods for assessing and improving the quality of the programs you write. I've used these methods, and I believe in them. To my way of thinking, SQA efforts are every bit as important as any other aspect of the software engineering process. If you take away only one thought from this article, please take this one: Quality cannot be tested into software; it can only be designed in. References 1. Roger S. Pressman, Software Engineering: A Practitioner's Approach, 2nd Edition, McGraw- Hill, 1987. 2. Boris Beizer, Software Testing Techniques, Van Nostrand Reinhold, 1983. 3. Boris Beizer, Software System Testing (testing) system testing - (Or "application testing") A type of testing to confirm that all code modules work as specified, and that the system as a whole performs adequately on the platform on which it will be deployed. and Quality Assurance, Van Nostrand Reinhold, 1984. 4. Glenford Myers, Software Reliability software reliability - See also formal methods, safety-critical system. ftp://ftp.sei.cmu.edu/pub/depend-sw. Mailing list: depend-sw@sei.cmu.edu. : Principles and Practices, John Wiley John Wiley may refer to:
|
|
||||||||||||||||||

Printer friendly
Cite/link
Email
Feedback
Reader Opinion