Good Testing Practices

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
Introduction to Unix – CS 21 Lecture 11. Lecture Overview Shell Programming Variable Discussion Command line parameters Arithmetic Discussion Control.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
Linux+ Guide to Linux Certification, Second Edition
Linux+ Guide to Linux Certification, Second Edition
A Guide to SQL, Seventh Edition. Objectives Embed SQL commands in PL/SQL programs Retrieve single rows using embedded SQL Update a table using embedded.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Introduction to Unix (CA263) Introduction to Shell Script Programming By Tariq Ibn Aziz.
Shell Programming, or Scripting Shirley Moore CPS 5401 Fall August 29,
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
Advanced Shell Programming. 2 Objectives Use techniques to ensure a script is employing the correct shell Set the default shell Configure Bash login and.
Introduction to Shell Script Programming
1 Chapter 9 Writing, Testing, and Debugging Access Applications.
Copyrighted material John Tullis 9/17/2015 page 1 04/08/00 Team Projects John Tullis DePaul Instructor
Week 7 Working with the BASH Shell. Objectives  Redirect the input and output of a command  Identify and manipulate common shell environment variables.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
An Introduction to Unix Shell Scripting
Copyrighted material John Tullis 10/6/2015 page 1 Performance: WebSphere Commerce John Tullis DePaul Instructor
Linux+ Guide to Linux Certification, Second Edition
1 Functions 1 Parameter, 1 Return-Value 1. The problem 2. Recall the layout 3. Create the definition 4. "Flow" of data 5. Testing 6. Projects 1 and 2.
Copyrighted material John Tullis 10/17/2015 page 1 04/15/00 XML Part 3 John Tullis DePaul Instructor
Shell Script Programming. 2 Using UNIX Shell Scripts Unlike high-level language programs, shell scripts do not have to be converted into machine language.
Linux+ Guide to Linux Certification, Third Edition
Writing Shell Scripts ─ part 3 CSE 2031 Fall October 2015.
Shell Programming Any command or a sequence of UNIX commands stored in a text file is called a shell program. It is common to call this file a command.
Linux+ Guide to Linux Certification Chapter Eight Working with the BASH Shell.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
Chapter 10: BASH Shell Scripting Fun with fi. In this chapter … Control structures File descriptors Variables.
Unified scripts ● Currently they are composed of a main shell script and a few auxiliary ones that handle mostly the local differences. ● Local scripts.
Linux+ Guide to Linux Certification, Third Edition
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
Shell Scripting – Putting it All Together. Agenda Escaping Characters Wildcards Redirecting Output Chaining and Conditional Chaining Unnamed and Named.
Chapter Six Introduction to Shell Script Programming.
Executable scripts. So far We have made scripts echo hello #for example And called it hello.sh Run it as sh hello.sh This only works from current directory?
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
THE C PROGRAMMING ENVIRONMENT. Four parts of C environment  Main menu  Editor status line and edit window  Compiler message window  “Hot Keys” quick.
Linux+ Guide to Linux Certification, Second Edition
If condition1 then statements elif condition2 more statements […] else even more statements fi.
Group, group, group One after the other: cmd1 ; cmd2 One or both: cmd1 && cmd2 Only one of them: cmd1 || cmd2 Cuddling (there):( cmd1 ; cmd2 ) Cuddling.
Lesson 6-Using Utilities to Accomplish Complex Tasks.
CS 403: Programming Languages Lecture 20 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Linux Administration Working with the BASH Shell.
Outline of Script Import Modules Setup Workspace Environment and Assign Data Path Variables Summary of Script Title and Author Info.
Subversion Subversion is a brand of version control software that is frequently used to store the code and documentation of a project so as to permit.
A Guide to SQL, Seventh Edition
Agenda Bash Shell Scripting – Part II Logic statements Loop statements
Scripts & Functions Scripts and functions are contained in .m-files
Writing Shell Scripts ─ part 3
Writing Shell Scripts ─ part 3
Agenda Control Flow Statements Purpose test statement
User Defined Functions
What is Bash Shell Scripting?
Compiling and Job Submission
(Chapter 2) John Carelli, Instructor Kutztown University
Data Structures and Programming Techniques
Chapter Four UNIX File Processing.
CSE 491/891 Lecture 21 (Pig).
The Linux Command Line Chapter 17
A QUICK START TO OPL IBM ILOG OPL V6.3 > Starting Kit >
Periodic Processes Chapter 9.
System Assurance Checklists
CST8177 Scripting 2: What?.
Introduction to Bash Programming, part 3
Debugging.
Implementation Plan system integration required for each iteration
Presentation transcript:

Good Testing Practices John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com Copyrighted material John Tullis 1/18/2019

Good Testing Practices Testing Preparation All functions/methods should be coded so that -DDEBUG will turn on #ifdef DEBUG sections of the code, that will enable the output of trace statements to a debugging or testing log. All functions/methods should be coded so that the path of all regular and error logging files, all input files, and all initialization files; are set by environmental variables accessed by getenv(). (Note - often all paths are specified in the initialization file, and that file only is found by getenv(). Copyrighted material John Tullis 1/18/2019

Good Testing Practices Testing Preparation continued... All functions/methods should be unit tested by unit test drivers that contain the main() function. Unit test drivers should test all conditional code branches, including error handling branches not normally activated. Programs as opposed to functions or object methods should follow this same approach. However, they should be activated for testing by confirming a command line argument that informs them they are to execute testing conditions. Copyrighted material John Tullis 1/18/2019

Good Testing Practices Test Structure There should be a separate testing directory structure area, with subdirectories for: test documentation, test scripts, compiled test programs, log files, error files, expected results, actual results, and difference files (diffs between expected and actuals). There should be test management scripts that execute the test scripts. There should be initialization or cleanup scripts that set up a test for a given run by cleaning up the results of a previous run. This may include an optional archive capability to store the results of multiple runs. Copyrighted material John Tullis 1/18/2019

Good Testing Practices Clean Up Delete log files Delete tmp files Delete test data in database tables Load Test Data Load test data into database tables. Copyrighted material John Tullis 1/18/2019

Good Testing Practices Execute Test Execute shell script that sets environmental variables. Shell script executes test program. Test program calls function(s)/object method(s) tested. Test results sent to database or log files. Error conditions kicked to error log. (Note that errors are to be deliberately generated to test the error conditionals in the code!) Copyrighted material John Tullis 1/18/2019

Good Testing Practices Validate Results Execute shell script that compares actual results with expected results. (Note that when results are database changes they must be exported to the actual results directory to enable comparison with the previously exported expected results.) Comparisons may be done by “diff”, output redirected to a diff file. If that file is not empty, a problem was encountered. This can be determined by something like this: “tre=`wc -c tmp.dif | sed ‘s/tmp.dif//’` | if [ $tre -gt 0 ] then ech Results are not as expected in $testnumberwhatever. Copyrighted material John Tullis 1/18/2019