Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automation Testing of Legacy Applications

Automation Testing of Legacy Applications

Everyone loves to work on a greenfield project. You can choose language, architecture, design from scratch, all the new, shiny stuff. The reality is that software engineers at some point need to work on or support legacy applications. It’s alive because it has some business value. The code is so messed up (“I just need to add one more ‘if’ to this method”), and the whole thing is held together by spit and baling wire. There are no automated tests safety net. Every change requires manual tests and a prayer to the software gods.

This talk will show you how to start small and work your way up to the point where you reach a confident state. It will show you how to optimize for the team happiness. It will affect topics such as, unit testing, acceptance tests, static code analysis, continuous integration, architecture for testability. The talk is inspired by real life experience, working on three legacy projects in the span of more than five years.

emanuil

June 04, 2015
Tweet

More Decks by emanuil

Other Decks in Programming

Transcript

  1. Functionality that makes money Must have functionality - compliance, security

    Repeating Manual Tests - Save Time Pareto Principle - 80/20
  2. Need to Call External System Comes from automated test? Talk

    to the real system No Fake the response Yes
  3. Scenario: Client admin should not be able to view master’s

    agencies Given а master user And master creates agency And a client admin When client admin views master's agency Then client admin should get an error
  4. Run on every commit Fast Hook one by one all

    the checks Run longer tests periodically
  5. CYCLOMATIC COMPLEXITY function testPrint() { echo('Hello World'); } Complexity: 1

    function testPrint($parameter) { if($parameter) { echo('Hello World'); } } Complexity: 2
  6. SQL Injection Detection (PHP and ADOdb) $dbConn->GetRow(“SELECT * FROM users

    WHERE id = $user_id”) $dbConn->GetRow(“SELECT * FROM users WHERE id = ?”, array(‘$user_id’))
  7. Аutomatе the most important functionalities Continuously improve static code quality

    Write unit tests for changed/new code Expand checks on commit Enable monitoring