Lecture 11b

1,045 views

Published on

  • Be the first to comment

  • Be the first to like this

Lecture 11b

  1. 1. Software Engineering: Analysis and Design (CSE3308) Lecture 11b: Software Development in Industry CSE3308/CSC3080/DMS/2000/26
  2. 2. Lecture 11b <ul><li>Software Development Process Topics </li></ul><ul><ul><li>Software Releases </li></ul></ul><ul><ul><li>Revision Control </li></ul></ul><ul><ul><li>Software Testing </li></ul></ul><ul><ul><li>Memory Usage Testing </li></ul></ul><ul><ul><li>GUI Testing </li></ul></ul>
  3. 3. Software Releases <ul><li>Release levels </li></ul><ul><li>Tree of revisions </li></ul><ul><li>Release Checklists </li></ul><ul><li>Release Checklist Example </li></ul><ul><li>Release Criteria </li></ul><ul><li>Defect Severity </li></ul><ul><li>Support Objectives </li></ul>
  4. 4. Release levels <ul><li>Four levels of controlled releases at OSA: </li></ul><ul><ul><li>Engineering Build (build) </li></ul></ul><ul><ul><ul><li>result of a product/system build </li></ul></ul></ul><ul><ul><ul><li>regularly built from ‘leaf code’ in the trunk and/or CPE branch </li></ul></ul></ul><ul><ul><ul><li>tested with automated test suite </li></ul></ul></ul><ul><ul><li>Alpha Release (alpha) </li></ul></ul><ul><ul><ul><li>shipped only to OSA internal staff </li></ul></ul></ul><ul><ul><ul><li>tested with automated test suite, and against Alpha Release Checklist </li></ul></ul></ul><ul><ul><li>Beta Release (beta) </li></ul></ul><ul><ul><ul><li>shipped only to nominated customer(s) and their OSA support staff . </li></ul></ul></ul><ul><ul><ul><li>tested with automated test suite, and against Beta Release Checklist </li></ul></ul></ul><ul><ul><li>Manufacturing Release (MR) </li></ul></ul><ul><ul><ul><li>shipped with new product and/or upgrade sales, and to all customers with a support contract. </li></ul></ul></ul><ul><ul><ul><li>tested with automated test suite, and against MR Release Checklist </li></ul></ul></ul>
  5. 5. Release levels <ul><li>Variations of an MR level Release: </li></ul><ul><ul><li>Patch </li></ul></ul><ul><ul><ul><li>a update to a Manufacturing Release to correct defects </li></ul></ul></ul><ul><ul><ul><li>built from code in a CPE (Customer Product Engineering) branch of the ‘revision tree’. </li></ul></ul></ul><ul><ul><ul><li>shipped with new product and/or upgrade sales, and to all customers with a support contract </li></ul></ul></ul><ul><ul><ul><li>tested as per an MR, with additional testing to ensure that it can be applied over a particular MR </li></ul></ul></ul><ul><ul><li>General Availability Release (GA) </li></ul></ul><ul><ul><ul><li>aka: Gold Release </li></ul></ul></ul><ul><ul><ul><li>concurrent availability of MR level releases for a product on all of its supported platforms. </li></ul></ul></ul><ul><ul><ul><li>tested as per an MR, for all supported platforms. </li></ul></ul></ul><ul><ul><ul><li>shipped with new product and/or upgrade sales, and to all customers with a support contract </li></ul></ul></ul>
  6. 6. Tree of revisions <ul><li>trunk revisions are on central line </li></ul><ul><li>branch revisions are to the sides </li></ul><ul><li>trunk revisions, branches and branch revisions can be labeled symbolically. </li></ul>3.0 3.48 4.0 4.12 4.36 ... 3.48.1 3.48.1.1 4.12.1 4.36.1 4.36.1.7 trunk d420p6 d420p7 d410 d350 CPE branch CPE branch branch rev. d420 d350p1 d300 d400 4.12.1.1 Product : OpenUI Development File: windows1.cxx
  7. 7. Release Checklists <ul><li>Checklists </li></ul><ul><ul><li>used to guide the release process </li></ul></ul><ul><ul><ul><li>document the release procedure </li></ul></ul></ul><ul><ul><li>confirm that all release criteria have been met met </li></ul></ul><ul><ul><li>record notes from release process </li></ul></ul><ul><ul><li>record sign-offs with dates </li></ul></ul><ul><ul><li>are accessible on-line through CGI based forms </li></ul></ul><ul><li>Checklists identify: </li></ul><ul><ul><li>Product Name </li></ul></ul><ul><ul><li>Package Name and Build Number </li></ul></ul><ul><ul><li>Release Platform/s </li></ul></ul><ul><ul><li>Product Distribution Details </li></ul></ul><ul><ul><li>Product Changes & Defect Fixes </li></ul></ul><ul><li>Example Release Checklist Sections </li></ul><ul><ul><li>Release Procedure </li></ul></ul><ul><ul><li>Product Configuration </li></ul></ul><ul><ul><li>Distribution Details </li></ul></ul><ul><ul><li>Product Change Details </li></ul></ul><ul><ul><li>LPE Checklist </li></ul></ul><ul><ul><li>Product Development Checklist </li></ul></ul><ul><ul><li>Quality Checklist </li></ul></ul><ul><ul><li>Support Checklist </li></ul></ul><ul><ul><li>Manufacturing Checklist </li></ul></ul><ul><ul><li>Release Sign-Off </li></ul></ul><ul><ul><li>Post-Signoff Processing </li></ul></ul><ul><ul><li>Announcement Approval </li></ul></ul><ul><ul><li>Notes </li></ul></ul>
  8. 8. Release Checklist Example <ul><li>Ref: Release Sign-Off Form </li></ul>
  9. 9. Release Criteria <ul><li>Test Coverage, Reliability, & Defects The following test coverage, minimum reliability, and defect rate criteria will be applied. NB: These criteria apply to both customer reported and OSA reported defects. </li></ul><ul><ul><li>For new or modified code </li></ul></ul><ul><li>Release Quality Improvement For MR releases, quality as measured against defect, reliability, and test coverage criteria will be on a par with, or better than, the prior release of the same product. </li></ul>
  10. 10. Defect Severity <ul><li>Critical The product can't be used. No work-around exists. </li></ul><ul><ul><li>Data corrupted or lost </li></ul></ul><ul><ul><li>System failure or lockup occurs </li></ul></ul><ul><ul><li>Incorrect answers when necessary for useful operation </li></ul></ul><ul><ul><li>Program aborts when used correctly </li></ul></ul><ul><ul><li>Corruption of O/S or system due to incorrect use of product </li></ul></ul><ul><li>Serious The product can't be used but a work-around exists. </li></ul><ul><ul><li>Much harder to use than reasonably expected </li></ul></ul><ul><ul><li>Defect with awkward or inefficient work-around </li></ul></ul><ul><ul><li>Defect with misleading output </li></ul></ul><ul><ul><li>Documentation functionally incorrect </li></ul></ul><ul><ul><li>Program aborts when used incorrectly </li></ul></ul>
  11. 11. Defect Severity <ul><li>Medium / Moderate The product is useable with moderate workaround that can be provided. </li></ul><ul><ul><li>Confusing user interface </li></ul></ul><ul><ul><li>Program aborts in malicious use </li></ul></ul><ul><ul><li>Defect is not serious to the operations of the user </li></ul></ul><ul><ul><li>Inefficient algorithm leads to substantial waste of time/space </li></ul></ul><ul><ul><li>Defect causes a preferred feature not to be used </li></ul></ul><ul><li>Low The product is useable with a simple workaround or fix. </li></ul><ul><ul><li>Grammatical error in output </li></ul></ul><ul><ul><li>Ugly screen layout </li></ul></ul><ul><ul><li>User misunderstanding because of somewhat unclear documentation </li></ul></ul><ul><ul><li>Cosmetic documentation error where correct use of the product is obvious </li></ul></ul>
  12. 12. Support Objectives <ul><li>Verification and Grading Period for Defects The Verification and Grading Period is the time from receipt of a Problem Report, until it is verified, analysed, and graded. </li></ul><ul><li>Rectification Period for Defects The Rectification Period includes the Verification and Grading Period. i.e. it is the total time from the first customer report of the defect, until a defect repair is delivered to the customer. </li></ul>
  13. 13. Revision Control <ul><li>Revision Control </li></ul><ul><li>Cron brings it all together </li></ul><ul><li>Daily RCS logs </li></ul><ul><li>Review processes </li></ul><ul><li>Formal review guidelines </li></ul>
  14. 14. Revision control <ul><li>Functions of a revision control system: </li></ul><ul><ul><li>Maintenance of a tree of revisions . </li></ul></ul><ul><ul><ul><li>RCS is used to maintain a complete history of changes (revisions) to a ‘source’ file. </li></ul></ul></ul><ul><ul><ul><li>In addition to the text of each revision, RCS stores the author, date and time of check in, and a log message summarizing the change. </li></ul></ul></ul><ul><ul><ul><li>RCS can maintain separate lines of development for each file. It stores a tree structure that represents the ancestral relationships among revisions. </li></ul></ul></ul><ul><ul><li>Resolution of access conflicts . </li></ul></ul><ul><ul><ul><li>When two or more people try to modify the same revision of a file, RCS alerts them and prevents one modification from corrupting the other . </li></ul></ul></ul><ul><ul><li>Merging of revisions and resolution of conflicts . </li></ul></ul><ul><ul><ul><li>Two separate lines of development of a file can be coalesced by merging. If the revisions to be merged affect the same lines of a file, RCS flags the overlapping changes. </li></ul></ul></ul><ul><ul><li>Release and configuration control . </li></ul></ul><ul><ul><ul><li>Revisions can be assigned symbolic names or labels. Labels can be used to identify a file revision in relation to Product Releases, and development milestones. When systematically applied, revision labeling can enable system configurations to be simply accessed and managed. </li></ul></ul></ul>
  15. 15. Cron brings it all together <ul><li>At OSA, every night, several machines do clean full build of the product, picking up all changes made during the day. This requires a large set of recursive makefiles </li></ul><ul><li>Every code change must be reviewed by at least one other engineer. The name of the reviewer and the DTS (work unit) number that is fixed by the change must be included in the RCS log for the change. </li></ul><ul><li>Every night, a report is generated by collating the RCS logs of all changes made that day. This report is checked by a manager the following day. </li></ul>
  16. 16. Cron brings it all together <ul><li>When each work unit is resolved, the engineer must include a labnotes file, describing the rationale behind the change, and a documentation file, if a documentation change is made. </li></ul><ul><li>Every night, a report is generated of all work units that have changed state, including the additional labnotes and documentation files. This report is checked by a manager the following day. </li></ul>
  17. 17. Daily RCS logs <ul><li>*** /src/forms/master/src/eqlib/common/fxform.cxx,v *** revision 3.2 date: 1996/04/12 04:25:39; author: shaun; state: Exp; lines: +4 -4 DTS 9001. Previous change wasn't quite correct. Reviewers: pca, agw. =============================================== *** /src/forms/master/src/eqlib/common/text1.cxx,v *** revision 3.33 date: 1996/04/12 06:07:20; author: joeca; state: Exp; lines: +4 -3 DTS9001: added member initialization for copy constructor to stop purify UMR's. Rev michael =============================================== *** /src/forms/master/src/eqlib/common/browser.cxx,v *** revision 1.11.3 date: 1996/04/12 06:09:17; author: michael; state: Exp; lines: +38 -29 DTS14306:Fixed msie i/f to work with dde calls. rev joeca. =============================================== </li></ul>
  18. 18. Review processes <ul><li>Reviews can be conducted at all stages in the development process: </li></ul><ul><li>The purpose of holding a review includes: </li></ul><ul><ul><li>to increase familiarity of code and designs within projects </li></ul></ul><ul><ul><li>to clarify and understand interfaces </li></ul></ul><ul><ul><li>to gain exposure to examples of code / design (both good and bad) </li></ul></ul><ul><ul><li>to provide feedback to the author </li></ul></ul><ul><ul><li>to find problems </li></ul></ul><ul><ul><li>to reduce testing phases </li></ul></ul><ul><ul><li>to stabilize design before coding </li></ul></ul><ul><ul><li>to increase exposure to the review process itself </li></ul></ul><ul><li>Reviews can be formal or informal </li></ul><ul><li>OSA has a practice that all code changes are at least informally reviewed. </li></ul>
  19. 19. Formal review guidelines <ul><li>In a formal review, each review attendee has a specific role to play: </li></ul><ul><ul><li>Author Organizes the review </li></ul></ul><ul><ul><li>Reader Conducts the review </li></ul></ul><ul><ul><li>Facilitator Controls the review </li></ul></ul><ul><ul><li>Inspector Attends the review to find problems </li></ul></ul><ul><ul><li>Observer Attends the review for experience </li></ul></ul><ul><li>Reviews are intended to identify problems not to solve them </li></ul><ul><li>Preparation by the Reader and Inspector is very important and may take several hours. </li></ul><ul><li>The reader &quot;reads&quot; code by describing what it is doing. The Inspector identifies problem areas as the Reader reaches them. The Author responds to questions about problems areas. When there is agreement on the identification of a problem, the Facilitator notes the problem, and the review continues on. </li></ul>
  20. 20. Formal review guidelines <ul><li>Formal reviews can be quite intimidating, but well run they are an excellent mechanism for improving the quality of the software and team effectiveness. </li></ul>
  21. 21. Software Testing <ul><li>Testing approaches and strategies </li></ul><ul><li>Software testing environment </li></ul><ul><li>Regression suites </li></ul><ul><li>Unit Test guidelines </li></ul>
  22. 22. Testing approaches and strategies <ul><li>Their are two main approaches: </li></ul><ul><ul><li>white-box testing : done with an understanding of the internals of the implementation </li></ul></ul><ul><ul><li>black-box testing : only concerned with the system’s external behavior </li></ul></ul><ul><li>With black-box testing, two main strategies: </li></ul><ul><ul><li>limits testing : push the limits of the system to see where and when it fails </li></ul></ul><ul><ul><li>equivalence partitioning : functions and parameters within the system can be divided into equivalence classes, one sample from each class is used for testing. </li></ul></ul>
  23. 23. Regression suites <ul><li>A Regression Test Suite is used to identify regressed, or unexpected charges in system behavior and performance, with respect to an established baseline. </li></ul><ul><ul><li>A regression suite is a group of tests designed to thoroughly test all required functionality of a system. </li></ul></ul><ul><ul><li>Typically, a regression suite is run against each new build of a product to see if any of its functionality has regressed with respect to the established baseline. </li></ul></ul><ul><li>Three important rules to follow when creating regression tests: </li></ul><ul><ul><li>Build the capability to recover from errors into every logical component of the regression </li></ul></ul><ul><ul><li>Structure the tests so that no component depends on the success of a previous component </li></ul></ul><ul><ul><li>Start each component from a known base state </li></ul></ul>
  24. 24. Unit Test guidelines <ul><li>Some Guidelines: </li></ul><ul><ul><li>a programmer should avoid testing their own code </li></ul></ul><ul><ul><li>thoroughly inspect the results of each test </li></ul></ul><ul><ul><li>test cases must be written for the invalid and unexpected (as well as the valid and expected) </li></ul></ul><ul><ul><li>make test cases and data repeatable </li></ul></ul><ul><ul><li>do not plan a testing effort on the tacit assumption that no errors will be found </li></ul></ul><ul><ul><li>testing is an extremely creative and intellectually challenging task </li></ul></ul>
  25. 25. Software testing environment <ul><li>Some commercial software testing tools are particularly useful: </li></ul><ul><ul><li>Memory test tools, e.g. Purify and TestCenter </li></ul></ul><ul><ul><li>GUI Test Tools, e.g. QA Partner and X Runner/WinRunner </li></ul></ul><ul><li>Memory Test Tools </li></ul><ul><ul><li>Memory errors in languages such as C and C++ are easy to make and can be quite difficult to find. </li></ul></ul><ul><ul><li>Memory Test Tools provide a form of internal limits testing, often detecting problems which become critical in extreme situations. </li></ul></ul><ul><li>GUI Test Tools </li></ul><ul><ul><li>File-based programs can be tested by comparing actual output files with expected output files. </li></ul></ul><ul><ul><li>For GUI programs, however, the &quot;output&quot; is to the screen. This output is not fixed but depends on screen size, resolution, and positioning. </li></ul></ul><ul><ul><li>Commercial tools provide specialized GUI toolkit drivers which accommodate this flexibility. </li></ul></ul>
  26. 26. end of lecture 11b
  27. 27. Memory Usage Testing <ul><li>Memory usage testing </li></ul><ul><li>Memory usage errors </li></ul><ul><li>Memory usage error examples </li></ul><ul><ul><li>UMR: Uninitialised Memory Read </li></ul></ul><ul><ul><li>ABR/W: Array Bounds Read/Write </li></ul></ul><ul><ul><li>FMR/W: Freed Memory Read/Write </li></ul></ul><ul><ul><li>FUM: Freeing Unallocated Memory </li></ul></ul><ul><li>How Purify Works </li></ul><ul><li>Memory leaks </li></ul>
  28. 28. Memory usage testing <ul><li>Recall, on UNIX, memory is available in the following areas: </li></ul><ul><ul><li>Data segment : initialized static memory </li></ul></ul><ul><ul><li>BSS segment : zeroed static memory </li></ul></ul><ul><ul><li>Stack : parameters and local variables </li></ul></ul><ul><ul><li>Heap : malloc'd memory </li></ul></ul>
  29. 29. Memory usage errors <ul><li>A number of memory errors can easily occur: </li></ul><ul><ul><li>UMR : Uninitialised memory read (stack, heap) </li></ul></ul><ul><ul><li>ABR/W : Array bounds read/write (heap) </li></ul></ul><ul><ul><li>FMR/W : Freed memory read/write (heap) </li></ul></ul><ul><ul><li>FUM : Freeing Unallocated Memory (heap) </li></ul></ul><ul><ul><li>NPR/W : Null Pointer Read/Write </li></ul></ul><ul><li>Error detection </li></ul><ul><ul><li>In C and C++, these errors are only detected when they cause a segmentation violation, often long after a detectable error has occurred. </li></ul></ul><ul><ul><li>Other languages provide checks which may detect errors earlier, but for debugging purposes the stack backtrace of who allocated the current or related chunks of memory is most useful </li></ul></ul><ul><li>Code should not leave home without being Purified. </li></ul>
  30. 30. UMR: Uninitialised Memory Read <ul><li>A UMR is a warning that uninitialised memory is about to be read. For example: </li></ul><ul><ul><li>main() { int num1, num2; num1 = num2 + 1; /* num2 is used */ exit (0) } </li></ul></ul><ul><li>will yield the following report: </li></ul><ul><ul><li>UMR: Uninitialised memory read: * This is occurring while in: main [line 5, test.c] * Reading 4 bytes from 0xf7fff348 on stack. * This is local variable &quot;num2&quot; in function main. </li></ul></ul>
  31. 31. UMR: Uninitialised Memory Read <ul><li>Often, uninitialised memory will be zero, especially during unit testing. Your program will seem to perform correctly but the UMR will eventually cause incorrect behavior. </li></ul><ul><li>If the memory about to be read has been allocated on the heap, then you get a stack backtrace of who allocated the memory: </li></ul><ul><ul><li>typedef struct { char *data_p; int length; } string; main() { string *sptr; int slen; sptr = (string *) malloc(sizeof(string)); slen = sptr->length + 1; exit(0); } </li></ul></ul>
  32. 32. UMR: Uninitialised Memory Read <ul><li>will yield the following report: </li></ul><ul><ul><li>UMR: Uninitialized memory read: * This is occurring while in: main [line 13, test.c] * Reading 4 bytes from 0x5f524 in the heap. * Address 0x5f524 is 4 bytes into a malloc'd block at 0x5f520 of 8 bytes. * This block was allocated from: malloc [rtlib.o] main [line 12, test.c] </li></ul></ul>
  33. 33. ABR/W: Array Bounds Read/Write <ul><li>An ABR/W indicates that the program is about to read or write a value before or after an allocated block. ABR indicates a warning , ABW indicates a corrupting error. For example: </li></ul><ul><ul><li>main() { char *orig = &quot;test&quot;; char * copy; copy = (char *) malloc(strlen(orig)); strcpy(copy, orig); free(copy); exit(0); } </li></ul></ul>
  34. 34. ABR/W: Array Bounds Read/Write <ul><li>will yield the following report: </li></ul><ul><ul><li>ABW: Array bounds write: * This is occurring while in: strcpy [rtlib.o] main [line 7, test.c] * Writing 5 bytes to 0x5f558 in the heap (1 byte at 0x5f55c illegal). * Address 0x5f558 is at the beginning of a malloc'd block of 4 bytes. * This block was allocated from: malloc [rtlib.o] main [line 6, test.c] </li></ul></ul>
  35. 35. FMR/W: Freed Memory Read/Write <ul><li>An FMR/W indicates that the program is about to read from or write to heap memory that has already been freed. FMR indicates a warning, FMW indicates a corrupting error. For example : </li></ul><ul><ul><li>main() { int * num_p; int other_num; num_p = (int *) malloc(sizeof(int)); free(num_p); other_num = *num_p + 1; exit(0); } </li></ul></ul>
  36. 36. FMR/W: Freed Memory Read/Write <ul><li>yields the following report : </li></ul><ul><ul><li>FMR: Free memory read: * This is occurring while in: main [line 8, test.c] * Reading 4 bytes from 0x5f530 in the heap. * Address 0x5f530 is at the beginning of a freed block of 4 bytes. * This block was allocated from: malloc [rtlib.o] main [line 6, test.c] * There have been 0 frees since this block was freed from: free [rtlib.o] main [line 7, test.c] </li></ul></ul>
  37. 37. FUM: Freeing Unallocated Memory <ul><li>An FUM indicates that the program is trying to free unallocated memory (duplicate free or free of bad heap pointer). FUM indicates a warning. For example: </li></ul><ul><ul><li>main() { char *mem_p; mem_p = (char *) malloc(10); free(mem_p); free(mem_p); exit(0); } </li></ul></ul>
  38. 38. FUM: Freeing Unallocated Memory <ul><li>yields the following report : </li></ul><ul><ul><li>FUM: Freeing unallocated memory: * This is occurring while in: free [rtlib.o] main [line 7, test.c] * Attempting to free block at 0x5f520 already freed. * This block was allocated from: malloc [rtlib.o] main [line 5, test.c] * There have been 1 frees since this block was freed from: free [rtlib.o] main [line 6, test.c] </li></ul></ul><ul><li>This error often occurs due to confusion about pointer ownership. </li></ul>
  39. 39. How Purify Works <ul><li>Purify checks every read, write, allocation and free of memory, and verifies whether these operations have been done legally. </li></ul><ul><li>Conceptually, Purify color codes the memory. It is coded into three colors at the byte level: </li></ul><ul><ul><li>Red : unallocated and uninitialised memory. It cannot be read, written or freed. The heap is initially red. </li></ul></ul><ul><ul><li>Yellow : allocated but not initialised. It can be written or freed, but cannot be read. Memory returned by malloc, and stack memory on function entry are set yellow. </li></ul></ul><ul><ul><li>Green : allocated and initialised. It can be read written or freed. The data and BSS segments are automatically set to green. </li></ul></ul><ul><li>Purify also maintains stack backtraces to specific depth for all memory operations. </li></ul>
  40. 40. How Purify Works <ul><li>At link time, Purify inserts checking code into the program to maintain the color-coded map of memory and detect errors. </li></ul><ul><li>Since it works at the object code level, it is able to detect errors in the entire program, including files for which you do not have the source. </li></ul>
  41. 41. Memory leaks <ul><li>Memory leaks are memory chunks that cannot be accessed or freed. They slow down a program by fragmenting or using memory, causing increased paging, or worse causing a program to run out of memory. </li></ul><ul><li>Purify gives a memory leakage report at the end of each run, indicating how much memory was leaked from each distinct memory allocation stack backtrace. </li></ul>
  42. 42. GUI Testing <ul><li>Graphical user interface (GUI) applications consist of a set of windows and graphical controls, such as buttons, menus, edit texts lists, and combo-boxes </li></ul><ul><li>GUI testing presents some special difficulties: </li></ul><ul><ul><li>System input/output is not fixed but depends on fonts, colors, screen size, screen resolution and positioning - record/playback is very sensitive to these changes </li></ul></ul><ul><ul><li>Screen snapshots generate too much low level data to be useful as expected output - one small change may invalidate all expected output </li></ul></ul><ul><ul><li>Tests may need to be portable across Microsoft Windows, OSF/Motif, Apple Macintosh, OS/2 Presentation Manager </li></ul></ul><ul><li>These problems are overcome with special GUI testing tools such as QA Partner and WinRunner. </li></ul>
  43. 43. How QA Partner works <ul><li>The QAP Recorder gets all the information the GUI has about each window and control on the screen, so the test scripts can refer to them by name, not by location and appearance. </li></ul><ul><li>Test scripts are written in 4Test, a C++ like language </li></ul><ul><li>Each test script has the general form: </li></ul><ul><ul><li>initialize GUI </li></ul></ul><ul><ul><li>perform test </li></ul></ul><ul><ul><li>check result </li></ul></ul><ul><ul><li>handle exceptions </li></ul></ul>QA Partner (+ script) QAP Recorder GUI Program QAP Agent
  44. 44. How QA Partner works <ul><li>The QAP Recorder gets all the information the GUI has about each window and control on the screen, so the test scripts can refer to them by name, not by location and appearance. </li></ul><ul><li>Test scripts are written in 4Test, a C++ like language </li></ul><ul><li>Each test script has the general form: </li></ul><ul><ul><li>initialize GUI </li></ul></ul><ul><ul><li>perform test </li></ul></ul><ul><ul><li>check result </li></ul></ul><ul><ul><li>handle exceptions </li></ul></ul>QA Partner (+ script) QAP Recorder GUI Program
  45. 45. How QA Partner works <ul><li>QA Partner runs the test script to perform test cases. </li></ul><ul><ul><li>The QAP Agent executes GUI actions and queries against the program under test. </li></ul></ul><ul><ul><li>Many Agents can simultaneously execute a single QAP script to enable distributed or multi-host testing. </li></ul></ul><ul><li>To allow a suite of Test Cases to be run, QA Partner implements an on-error recovery system that can restore the application back to a pre-defined state. </li></ul>QA Partner (+ script) QAP Recorder GUI Program QAP Agent
  46. 46. Referring to GUI Objects <ul><li>Windows and controls in a GUI are organized as a hierarchy </li></ul><ul><ul><li>Each window and control is an instance of a class </li></ul></ul><ul><ul><li>All windows or controls have associated text, such as the title of a window, the label of a button, the label of a menu </li></ul></ul><ul><li>GUI objects are identified by a sequence of components corresponding to the object hierarchy. </li></ul><ul><ul><li>Components can be separated by ”.&quot; </li></ul></ul><ul><ul><li>Each component can consist of: </li></ul></ul><ul><ul><ul><li>the object's class, denoted by &quot;[class]&quot; </li></ul></ul></ul><ul><ul><ul><li>the object's name can be specified as follows: </li></ul></ul></ul><ul><ul><ul><ul><li>its associated text </li></ul></ul></ul></ul><ul><ul><ul><ul><li>internal GUI ID </li></ul></ul></ul></ul><ul><ul><ul><ul><li>ordinal number in relation to other objects at that level in hierarchy, </li></ul></ul></ul></ul><ul><ul><ul><ul><li>prior static text associated with object </li></ul></ul></ul></ul><ul><ul><li>For example : </li></ul></ul><ul><ul><ul><li>OurApp.Open.Files is a listbox on a dialog that is identified by “Files”, “#1”, “$4046”, “(56, 94)” </li></ul></ul></ul><ul><ul><ul><li>OurApp.Open.OK is a button on a dialog </li></ul></ul></ul>
  47. 47. Properties and operations on objects <ul><li>Each class has a built-in set of attributes and methods </li></ul><ul><li>For example the built-in window class Menu includes these attributes: </li></ul><ul><ul><li>lsContents The contents of the menu </li></ul></ul><ul><ul><li>bEnabled Whether the menu is enabled </li></ul></ul><ul><li>It also includes these methods: </li></ul><ul><ul><li>GetContents Gets the contents of the menu (an enquiry method) </li></ul></ul><ul><ul><li>IsEnabled Checks if the menu is enabled (a state query method) </li></ul></ul><ul><ul><li>Pick Selects an item from the menu (a GUI action method) </li></ul></ul><ul><ul><li>VerifyContents Verifies that the menu has the expected contents (a verification method) </li></ul></ul>
  48. 48. Questions

×