Difference between revisions of "Fragile Test"

From CitconWiki
Jump to navigationJump to search
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<nowiki>Less Fragile Tests
+
== Less Fragile Tests ==
  
Tests
+
=== Tests ===
Asserts
 
Component
 
Integration
 
Functional
 
UAT
 
Non-Functional
 
Perf
 
Security
 
Usability
 
 
See ISO 9126
 
  
Good Tests
+
* Asserts
    Pass Repeatedly
+
** Component
Timing (e.g. Selenium)
+
** Integration
External Dependencies
+
* Functional
External Systems
+
** UAT
Reliability
+
* Non-Functional
Availability
+
** Perf
Data
+
** Security
Set Values
+
** Usability
Incorrect State
+
* See ISO 9126
Heavy Mocking
 
Utility to build mocks
 
Easy switching mock to real
 
  
Bad Test
+
=== Good Tests ===
Hidden cause of failure
 
Visible Replay using TimeSnapper
 
Visible Replay
 
Dump state data at failure
 
  
 +
* Pass Repeatedly
 +
** Timing (e.g. Selenium)
 +
** External Dependencies
 +
*** External Systems
 +
**** Reliability
 +
**** Availability
 +
*** Data
 +
**** Set Values
 +
**** Incorrect State
 +
** Heavy Mocking
 +
*** Utility to build mocks
 +
*** Easy switching mock to real
 +
**** use same data, settings
  
Tool advice
+
=== Bad Tests ===
Time Snapper
+
* Hidden cause of failure
EasyMock
+
** use screen capture logger, e.g. TimeSnapper
Pretend Classes
+
* Visible Replay
DBUnit gets prod snapshot regularly (security issues: scrubbing)  Table dependancies makes it a significant task
+
* Dump state data at failure
  
Data
+
=== Tool advice ===
Domain (name, addr, etc class pulled from DB
+
* Time Snapper
(abstracted data from test)
+
* EasyMock
Data Driven Approach
+
* Pretend Classes
Fitness Integration Testing  
+
* DBUnit gets prod snapshot regularly (security issues: scrubbing)  Table dependancies makes it a significant task
 +
 
 +
=== Data ===
 +
* Domain (name, addr, etc class pulled from DB
 +
* (abstracted data from test)
 +
* Data Driven Approach
 +
* Fitness Integration Testing  
  
 
Strong correlation between importance of tests depending on the types of testing and what kind of thing you are doing (Product type development = high focus on test vs bespoke = low focus
 
Strong correlation between importance of tests depending on the types of testing and what kind of thing you are doing (Product type development = high focus on test vs bespoke = low focus
  
  
Suggestion
+
=== Suggestion ===
Use a virtual machine, setup - refresh test machine using VMWARe to simulate MSG based, 20 mins business transactions
+
* Use a virtual machine, setup - refresh test machine using VMWARe to simulate MSG based, 20 mins business transactions
  
Test Data Repository
+
=== Test Data Repository ===
Used keyword substitution to create the real data
+
* Used keyword substitution to create the real data
  
Typical Data
+
=== Typical Data ===
Edge / Border cases, Exception testing
+
* Edge / Border cases, Exception testing
  
Broken windows
+
=== Broken windows ===
Continually failing, low priority tests/defects cause a 'Broken windows' effect which degrades the value of CI.
+
* Continually failing, low priority tests/defects cause a 'Broken windows' effect which degrades the value of CI.
</nowiki>
 

Latest revision as of 02:46, 30 July 2007

Less Fragile Tests

Tests

  • Asserts
    • Component
    • Integration
  • Functional
    • UAT
  • Non-Functional
    • Perf
    • Security
    • Usability
  • See ISO 9126

Good Tests

  • Pass Repeatedly
    • Timing (e.g. Selenium)
    • External Dependencies
      • External Systems
        • Reliability
        • Availability
      • Data
        • Set Values
        • Incorrect State
    • Heavy Mocking
      • Utility to build mocks
      • Easy switching mock to real
        • use same data, settings

Bad Tests

  • Hidden cause of failure
    • use screen capture logger, e.g. TimeSnapper
  • Visible Replay
  • Dump state data at failure

Tool advice

  • Time Snapper
  • EasyMock
  • Pretend Classes
  • DBUnit gets prod snapshot regularly (security issues: scrubbing) Table dependancies makes it a significant task

Data

  • Domain (name, addr, etc class pulled from DB
  • (abstracted data from test)
  • Data Driven Approach
  • Fitness Integration Testing

Strong correlation between importance of tests depending on the types of testing and what kind of thing you are doing (Product type development = high focus on test vs bespoke = low focus


Suggestion

  • Use a virtual machine, setup - refresh test machine using VMWARe to simulate MSG based, 20 mins business transactions

Test Data Repository

  • Used keyword substitution to create the real data

Typical Data

  • Edge / Border cases, Exception testing

Broken windows

  • Continually failing, low priority tests/defects cause a 'Broken windows' effect which degrades the value of CI.