Michael Eng Mentors: Mark Pumphrey, Greg Cordero

Slides:



Advertisements
Similar presentations
Detecting Bugs Using Assertions Ben Scribner. Defining the Problem  Bugs exist  Unexpected errors happen Hardware failures Loss of data Data may exist.
Advertisements

Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
Road Map Introduction to object oriented programming. Classes
Well-behaved objects 4.0 Testing. 2 Objects First with Java - A Practical Introduction using BlueJ, © David J. Barnes, Michael Kölling Main concepts to.
16-Jun-15 Exceptions. Errors and Exceptions An error is a bug in your program dividing by zero going outside the bounds of an array trying to use a null.
Terms and Rules Professor Evan Korth New York University (All rights reserved)
Testing an individual module
Options for User Input Options for getting information from the user –Write event-driven code Con: requires a significant amount of new code to set-up.
Unit Testing & Defensive Programming. F-22 Raptor Fighter.
Coding Methodology How to Design Code. © 2005 MIT-Africa Internet Technology Initiative Pay Attention to Detail When implementing or using APIs details.
JUnit in Action SECOND EDITION PETAR TAHCHIEV FELIPE LEME VINCENT MASSOL GARY GREGORY ©2011 by Manning Publications Co. All rights reserved. Slides Prepared.
CS1: chr, jeh, & Testing vs. Debugging Testing finds problems –Unit test –Integration test –System test Debugging finds and fixes causes.
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
TJHSST Computer Systems Lab Automation of Testing in the Distributed Common Ground System (Army) Michael Eng Mentor: Mark Pumphrey Northrop Grumman.
Unit Testing with JUnit and Clover Based on material from: Daniel Amyot JUnit Web site.
Fall 2002CS 150: Intro. to Computing1 Streams and File I/O (That is, Input/Output) OR How you read data from files and write data to files.
Scalatest. 2 Test-Driven Development (TDD) TDD is a technique in which you write the tests before you write the code you want to test This seems backward,
©SoftMoore ConsultingSlide 1 Serialization. ©SoftMoore ConsultingSlide 2 Serialization Allows objects to be written to a stream Can be used for persistence.
Classes, Interfaces and Packages
Programming & Debugging. Key Programming Issues Modularity Modifiability Ease of Use Fail-safe programming Style Debugging.
CS/ENGRD 2110 FALL 2013 Lecture 3: Fields, getters and setters, constructors, testing 1.
CHAPTER 6 ARRAYS IN C 1 st semester King Saud University College of Applied studies and Community Service Csc 1101 F. Alakeel.
Editing and Debugging Mumps with VistA and the Eclipse IDE Joel L. Ivey, Ph.D. Dept. of Veteran Affairs OI&T, Veterans Health IT Infrastructure & Security.
CSE 143 Lecture 14: testing.
Classic Buffer OVERFLOW ATTACKS CSCE 548 Student Presentation Mouiad Al Wahah.
Modular Decomposition, Abstraction and Specifications
Lecture 5:Interfaces and Abstract Classes
CMSC 345 Defensive Programming Practices from Software Engineering 6th Edition by Ian Sommerville.
Software Construction Lab 10 Unit Testing with JUnit
JAVA MULTIPLE CHOICE QUESTION.
Chapter 7 User-Defined Methods.
Dept of Computer Science University of Maryland College Park
The Joy of Breaking Code Testing Logic and Case Selection
CS1101X Programming Methodology
Eclipse Navigation & Usage.
Testing and Debugging.
Computer Science 209 Testing With JUnit.
Testing & Testing Tools
Chapter 3 Inheritance © 2006 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
Software Engineering 1, CS 355 Unit Testing with JUnit
Exceptions 10-Nov-18.
Design by Contract Fall 2016 Version.
Designing and Debugging Batch and Interactive COBOL Programs
History, Characteristics and Frameworks
Topics Introduction to File Input and Output
Overview of Eclipse Lectures
Java Programming Language
Chapter 12 Exception Handling
Test-driven development (TDD)
Unit 6 Working with files. Unit 6 Working with files.
CSE 303 Concepts and Tools for Software Development
Automation of Testing in the Distributed Common Ground System (Army)
Automation of Testing in the Distributed Common Ground System (Army)
Bugs & Debugging - Testing
Section 4: Graphs and Testing
Interfaces.
CSE 143 Lecture 5 More ArrayIntList:
Exceptions 25-Apr-19.
Exceptions 22-Apr-19.
CSE 1020:Software Development
Exceptions 10-May-19.
CMPE212 – Reminders Assignment 2 due today, 7pm.
Topics Introduction to File Input and Output
EECE.2160 ECE Application Programming
Exceptions 5-Jul-19.
SPL – PS1 Introduction to C++.
CHAPTER 6 Testing and Debugging.
Unit Testing.
Testing Slides adopted from John Jannotti, Brown University
Presentation transcript:

Automation of Software Testing for the Distributed Common Ground System – Army (DCGS-A) Michael Eng Mentors: Mark Pumphrey, Greg Cordero Northrop Grumman Mission Systems

Outline Purpose DCGS-A overview JUnit Automation of Testing Problems Encountered Results/Conclusion

Explore methods of software testing and testing automation Purpose Explore methods of software testing and testing automation Help to test and debug the DCGS-A project Improve software quality Meet functional and contractual requirements Ensure functionality in deployment

What is DCGS-A? Distributed Common Ground System- Army Signals Intelligence branch SIGINT Modular & decentralized Integrate multiple types/sources of intelligence Infrastructure of Java, JavaBeans, Oracle Similar efforts taking place in other branches of the military

CPP Shelter on Armored M1152 –Assured Mobility for BCT, Div, and Above Common Shelter in Battle Command

Why Test Software? Software developed for the US Military must be, to the absolute extent possible, free of error because lives and mission are at stake. System crashes in field Loss of communication between commander and soldiers No one knows where the enemy is Intelligence database cannot be updated System is hacked Self-explanatory

JUnit Unit testing framework for Java Part of xUnit family of frameworks Test classes correspond to main classes E.g., MyClass.java & MyClassTest.java Test and main directories parallel each other Run  status bar- green or red Used with Eclipse to test DCGS-A Perfect for testing individual instances of objects, methods, etc. http://www.onjava.com/pub/a/onjava/2005/07/13/pisces.html?page=2

Methodology/Procedure Each method with logic is tested Every constructor is tested Unit testing- method input arguments, conditional statements tested Edge testing Dummy objects Hardcoded characteristics- force all possibilities JUnit4TestRunner, Logger JUnit formatting JUnit Javadoc notation- @Before, @After, @Test Assertions E.g., assertEquals(array[0], “Proper answer”); assertNull([something that returns null]); Expected void test (expected =NullPointerException.class) Exception testing “logic…that is, not a simple get or set method” THIS INCLUDES GARBAGE DATA AND RANDOMLY GENERATED DATA- FUZZ TESTING

Procedure Continued One method can have many, many cases Vast majority of possibilities must be tested Errors, if-else ladders, arguments, etc. “Hardened” classes important System must be protected Reflection, buffer overflow attacks Make sure values are private/final Bounds checking for overflow attacks “One method can have many, many cases”…and most, if not all need to be covered in testing “System must be protected…tactics like reflection and data overflow attacks have to be handled- for example reflection can be stopped by making critical values private and final, and many overflow attacks can be stopped with bounds checking” http://www.dabbledoo.com/ee/images/uploads/gamertell/access_denied.jpg

Example Test Program class myClass{ class myClassTest static char parse (String s){ …logic to parse out the first number character in a String (e.g. ‘3’ in “ABC3WW5”)… return that number as a char or null if not found } class myClassTest void testParse() myClass.parse(null); void testParse2() myClass.parse(“”); void testParse3() myClass.parse(“ABC”); void testParse4() myClass.parse(“3##”); void testParse5() myClass.parse(“53”); void testParse6() myClass.parse( new Object().toString()); void testParse7() myClass.parse(new Integer(54)); void testParse8() myClass.parse(new String[2]); And so on… Say we have a class MyClass with method parse that gets the first number character in an input String and returns it or null if there’s no numbers in the string. On the right we have a JUnit test class. So, we test the method by sending null. Then we send an empty String and expect a null output, or maybe an Exception if the method doesn’t check for that sort of thing (which we would then fix in the main class). Then we send a String that’s all letters and expect it to return null. Then a string that actually has a number. Then an all-number string. Then an Object forced into a String. Then an Integer object. Then a String array instead of an object. We could even go so far as to send a string one character too large (32767 is the limit) to see how gracefully the program handles overflows. And so on.

Automation Tests are written, now what? JUnit AllTests- template for mass runs Project has over 700 test methods Before automation- run each test class manually Hours After automation- run one root test class 10 seconds “Each subdirectory has an AllTests file that basically loads either the AllTests files below it, or loads each test class into it and runs the tests. It actually only takes a little under 10 seconds to run the whole system’s tests. So that saves a LOT of time.” http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac/images/WindowsJUnit.gif

Problems Encountered External frameworks Test dependency hell Undocumented or still being integrated Test dependency hell E.g., testing a class nested in another that depends on unavailable/unfinished properties file Not really a problem, but constant updates to data classes still in development/pre-debugging Constant updates of old tests http://gallery.nofactzone.net/albums/userpics/normal_headdesk.jpg

Results/Conclusion Created over 20 test classes Modified over 10 existing test classes (bug/build fixes, etc.) Found and fixed 10 bugs using test classes Wrong classifications Incorrect date calculations Incorrect order of if-else ladders Still working on getting 100% function, path, and condition coverage for classes that need testing Modifying existing tests to reflect updates in development

Questions?