software testing eliane collins o&l/leq 1 © 2008 indt 2008-08-26 / leq

33
Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Upload: stephen-gilbert

Post on 27-Dec-2015

229 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Software Testing

Eliane Collins

O&L/LEQ

1 © 2008 INdT 2008-08-26 / LEQ

Page 2: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

2 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTINGSummary:

• Software Testing Introduction

• Software Test Process

• Unit Test Concepts

• Functional Software Test Concepts

• Software Test in the Rails and Ruby environment

Page 3: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

3 © 2008 INdT RECOF.ppt / 2008-06-06 / LEQ 3

SOFTWARE TESTING

Software Testing Introduction

Page 4: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Software Testing Introduction:

• What is Software Testing?• Software testing is the process of checking software, to verify that

it satisfies its requirements and to detect errors. • According to Myers "Software Testing is the process of executing a

program or system with the intent of finding errors.“

• According to the definition given by Hetzel, "Testing involves any activity aimed at evaluating an attribute or capability of a program or system and determining that it meets its required results

SOFTWARE TESTING

4 © 2008 INdT 2008-08-26 / LEQ

Page 5: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Software Testing Introduction:

• Why do Software Testing? • Because of the fallibility of its human designers and its own

abstract, complex nature, software development must be accompanied by quality assurance activities.

• Software Testing Fundamentals • Testing is a process of executing a program with the intent of

finding an error.

• A good test case is one that has a high probability of finding an as yet undiscovered error.

• A good test must be A-TRIP: Automatic, Thorough, Repeatable, Independent and Professional.

5 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 6: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

6 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 7: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Software Testing Introduction:

• Software testing answers questions that development testing and code reviews can’t.

• Does it really work as expected?

• Does it meet the users’ requirements?

• Is it what the users expect?

• Do the users like it?

• Is it compatible with our other systems?

• How does it perform?

• Which areas need more work?

• Is it ready for release?

7 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 8: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Software Testing Introduction:

• What can we do with the answers to these questions?

• Save time and money by identifying defects early

• Avoid or reduce development downtime

• Provide better customer service by building a better application

• Know that we’ve satisfied our users’ requirements • Build a list of desired modifications and enhancements for later

versions

• Identify and catalog reusable modules and components • Identify areas where programmers and developers need training

8 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 9: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Software Testing Introduction:

•Who Does The Testing? •Software testing is not a one person job. It takes a team, larger or smaller depending on the size and complexity of the application being tested.

•The programmer(s) should have a reduced role in the testing if possible, because they are so intimately involved with the product and “know” that it works that they may not be able to take an unbiased look at the results of their labors.

•Testers must be cautious, curious, critical but non-judgmental, and good communicators. One part of their job is to ask questions that the developers might find not be able.

•Roles: test lead/manager, test designer (test analyst, test engineer) , tester, test automater/automation developer, and test administrator.

9 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 10: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Software Testing Introduction:

•What is a defect, an error and a failure?•A programmer makes an error (mistake), which results in a defect (fault, bug) in the software source code. If this defect is executed, in certain situations the system will produce wrong results, causing a failure.

•How to Test?•Whitebox Testing: testing the code: code coverage, mutation testing, fault injection methods, static testing.

•Graybox Testing or Integration testing: individual software modules are combined and tested as a group. It follows unit testing and precedes system testing.

•Blackbox Testing: treats the software as a black-box without any knowledge of internal implementation.

10 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 11: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Software Testing Introduction:

•Techniques:

11 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 12: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Software Testing Introduction:

•Testing artifacts:•Test plan: approach to testing a system such as a software. The plan typically contains a detailed understanding of what the eventual workflow will be.

•Test case: set of conditions or variables under which a tester will determine if a requirement or use case upon an application is partially or fully satisfied.

•Test script: the combination of a test case, test procedure, and test data.

•Test suite: The most common term for a collection of test cases.

•Test case specification: Document with all list of functional test cases to be executed and the results.

•Test harness or automated test framework: is a collection of software and test data configured to test a program unit by running it under varying conditions and monitor its behavior and outputs.

12 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 13: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

13

SOFTWARE TESTING

Software Testing Process

13 © 2008 INdT 2008-08-26 / LEQ

Page 14: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Software Test Process:

14 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 15: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Software Test Process:

•Test Plan:

•Test Design or Test Specification:

•Test Summary report

15 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Microsoft Word Document

Microsoft Word Document

Microsoft Word Document

Page 16: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Software Test Process:

•Defect Tracking•The functional defects found should be registered, watched and managed during the software development. One person should be responsible for the defect tracking control (the bugtracker).

•The status of a defect can be:

• New

• Open (or assign)

• Invalid (or not a bug, Incomplete, reject, etc.)

• Won’t fix (postponed)

• Duplicated

• Fixed

• Closed

• Re-opened16 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 17: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

17 © 2008 INdT 2008-08-26 / LEQ

Page 18: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Software Test Process:

•Defect Tracking tools : Gforge, Bugzilla, Mantis, ClearQuest…

•Data to register a defect:

•Project name

•Synopsis

•Release version

•Pre-requirements, Steps to reproduce, Expected results and System results

•Owner

•Assign to

18 © 2008 INdT 2008-08-26 / LEQ

Page 19: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

19 © 2008 INdT RECOF.ppt / 2008-06-06 / LEQ 19

SOFTWARE TESTING

Unit Test Concepts

Page 20: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Unit Testing Concepts:

• Unit Test is a piece of code written by a developer that exercises a very small and specific area of the code.

• First step is to decide how to test the method, with this idea, you proceed to write the test code. Next, the test must be run. It’s important that all the tests pass.

• Using Right-Bicep:

• Right – Are the results right?

• B – boundary conditions

• I – inverse relationships

• C - Cross-check

• E – error conditions

• P – are performance characteristics within bounds?20 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 21: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Unit Testing Concepts:

• Excuses for not testing:

• Its take too much time...

• It’s not my job to test my code...

• But it compiles!

• I’m being paid to write code, not to test...

• I feel guilty about putting testers and QA out of work...

Page 22: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Unit Testing Concepts:

• Criteria: At least 80% code coverage.

• Unit Testing Tools:

• JUnit Test - http://www.junit.org/

• TestNG - http://testng.org/doc/

• J2MEUnit - http://j2meunit.sourceforge.net/

• CppUnit - http://cppunit.sourceforge.net/

• JCoverage - http://maven.apache.org/maven-1.x/plugins/jcoverage/

22 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 23: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

23 © 2008 INdT RECOF.ppt / 2008-06-06 / LEQ 23

SOFTWARE TESTING

Functional Testing Concepts

Page 24: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Functional Testing Concepts:• Test the functionality according to the requirements.

• Test the entire system from end to end, it compares individual results to expected values.

• the role of functional tests as a medium of communication and supplement to stories in the dialog between development and customer.

• Can be automatics, it’ s depends of the test strategy.

• Techniques:

• Scripting Tests

• Exploratory Tests

• Manual Tests

• Automated Tests

24 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 25: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Functional Testing Concepts:

• Non-functional tests:

• Performance testing : checks to see if the software can handle large quantities of data or users.

• Security testing: to prevent system intrusion by hackers.

• internationalization and localization: is needed to test these aspects of software, for which a pseudo localization method can be used.

• Stress testing: the application is executed many times to see if the software can handle many operations.

Page 26: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

26 © 2008 INdT 2008-08-26 / LEQ

Functional Testing Tools:

• Criteria: 100% tests pass

• Tools:

• Selenium Test – functional automated test. (http://selenium.openqa.org/)

• Jmeter – performance tests. (http://jakarta.apache.org/jmeter/)

• Fitnesse - functional automated test. (http://fitnesse.org/)

• Rational Robot - functional automated test.

• Rational Functional Tester - web functional automated test.

• Test Complete- functional and performance automated test.

• OpenLoad Tester – performance tests.

SOFTWARE TESTING

Page 27: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

27 © 2008 INdT RECOF.ppt / 2008-06-06 / LEQ

SOFTWARE TESTING

Software Testing in Ruby on Rails environment

Page 28: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Ruby on Rails Testing Process:

• Ruby on Rails:• Ruby is an agile script language

• Write more understandable code in less lines, Free (Very open license) and Extensible.

• Principles: Makes programmers happy and makes Ruby easy to learn.

• Ruby on Rails promotes agile practices

• Rails is a meta-framework to agile web applications

• According to the Model-View-Control pattern of separation.

28 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 29: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

29 © 2008 INdT 2008-08-26 / LEQ

Page 30: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Ruby on Rails Testing Process:

• Test Driven Development (TDD): Do the tests first.

30 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 31: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Ruby on Rails Testing Process:

• Test Driven Development (TDD) Benefits:

• Better code quality

• Tests become Safety

• Eliminate Bugs

• 100% test coverage

• Code proven to meet requirements

• Risks:

• Requirements changes : re-work

• Some tests are more complex to implement then the application code.

31 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 32: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

Ruby on Rails Testing Process:

• Unit Testing - TDD• Rails includes Ruby’s test/unit

• Rake pre-configured to run test suite or individual tests

• Easy to load fixtures into a test case

• Functional Testing

• Controllers testing

• Automatic - Selenium

32 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING

Page 33: Software Testing Eliane Collins O&L/LEQ 1 © 2008 INdT 2008-08-26 / LEQ

References:

• Software Testing Wikipedia - http://en.wikipedia.org/wiki/Software_testing

• Rails Wiki - http://wiki.rubyonrails.com/

• Pragmatic Unit Testing in java with Junit, Hunt Andrew, 2005.

• Software Testing Fundamentals—Concepts, Roles, and Terminology , John E. Bentley, Wachovia Bank, Charlotte NC. www2.sas.com/proceedings/sugi30/141-30.pdf

• TDD Wikipedia - http://en.wikipedia.org/wiki/Test-driven_development

• The Software Testing Life-Cycle, Andrew Ireland. www.macs.hw.ac.uk/~air/se4/pdflec/lec-1-life-cycle-a5.pdf

33 © 2008 INdT 2008-08-26 / LEQ

SOFTWARE TESTING