Search
Close this search box.
Search
Close this search box.
Search
Close this search box.

5 steps to get unit tests going

Facebook
Twitter
LinkedIn
Pinterest
WhatsApp

Once you start unit testing, you will find significant benefits to your design, throughput, quality, and peace of mind. However, it is not easy to start in an organization that’s not used to it. Here are a number of practical tips:

First step: Make sure the motivation is there – as you will see down the list, this change (like most changes) will require the organization to invest time and work in it. Understand the current situation, understand the pains, get some statistics. There will usually be someone who tried writing unit tests – talk with them, try to understand the challenges. Have a kickoff meeting with the team, understand together why are you doing this and how will the process look like. Have a kickoff with management, you will definitely need their support, you need to be on the same page. Whenever it gets tough (it will), get back to this discussion.

Second step: Train the team – I think training should be minimal – just enough so people will understand what they’re going into. Most of the learning is on the job. I do one day training in which I teach the basics of unit tests in the specific technology (I had lately the opportunity of working with an organization in which I taught c# with visual studio tests, react/native with jest + testing library, angularjs with jest and java with junit). We do some TDD with mob programming and finish with unit tests on legacy code techniques.

At this point some people (highly motivated) may start experimenting. Help them.

Third step: Open roads in the legacy code – adding tests to legacy code is difficult at the beginning. Pair with motivated individuals to crack it up, and find patterns to use on their legacy code (see my video about this: English / Hebrew). Sometimes you’ll need utilities, sometimes you’ll need to do some refactoring to allow people to start work.

Are people starting to write tests? Sometimes they do.

Fourth step: Pair with developers – We had the training, we opened up the roads, and now it is time to start moving the ship. Experience tells me I need to sit with almost all developers and pair with them, writing their first tests. Only when you do that realization seeps in. There are many A-Ha moments, I like it.

You would expect people to start writing unit tests by this time. However, change is very difficult. Remember at the beginning writing the unit test is an additional effort. It returns the investment very fast but it is an additional effort.

Fifth step: Let developers write unit tests without you – this is where, together with the team, we start adding the tests gently into the definition of done. They must do it without you, they must wrestle with the legacy code to get it moving. Like other technological challenges, you need some intensity to grasp them. This is the difficult part.

The first time you change code that already has unit tests is a magical moment. The tests tell you the story in simple words, they guide you and keep you safe. The time and sweat were worth it.

 

Subscribe for Email Updates:

Categories:

Tags:

Iterative Incremental Development
Agile Risk Management
Agile Release Management
Lean Agile
Atlassian
POPM
Value Streams
System Integration Environments
NIT
Systems Thinking
Limiting Work in Progress
Introduction to ATDD
Reading List
Frameworks
GanttBan
EOS®
RTE Role
Kaizen Workshop
Jira admin
Agile Release Planning
Kaizen
LAB
Applying Agile Methodology
Program Increment
Scrum
Large Scale Scrum
Agile Development
Risk Management on Agile Projects
ART Success
Effective Agile Retrospectives
Release Train Engineer
Agile Product Ownership
ATDD vs. BDD
Jira
Quality Assurance
Lean Startup
Acceptance Test-Driven Development
Introduction to Test Driven Development
Presentation
SPC
Continuous Improvement
AI
Legacy Enterprise
Sprint Iteration
Artificial Intelligence
Nexus
ScrumMaster Tales
Scaled Agile Framework
DevOps
Kanban Basics
SAFe DevOps
Agile Outsourcing
Certification
Implementing SAFe
Accelerate Value Delivery At Scale
Lean-Agile Software Development
Self-organization
QA
Risk-aware Product Development
Product Management
Coaching Agile Teams
RSA
Change Management
Nexus Integration Team
Scrum Guide
Elastic Leadership
Lean Agile Management
Kanban 101
AgileSparks
Agile in the Enterprise
Legacy Code
Agile Product Development
Agile
Manage Budget Creation
Video
Lean-Agile Budgeting
Lean Budgeting
Agile Delivery
The Kanban Method
Lean Risk Management
predictability
Agile Contracts Best Practices
User stories
ARTs
Tips
Slides
System Team
Pomodoro Technique
Code
Lean and Agile Techniques
Agile Israel
LeSS
Jira Plans
TDD
ROI
Agile Basics
Business Agility
Managing Projects
speed @ scale
Continuous Delivery
Kanban Kickstart Example
Process Improvement
Webinar
PI Planning
Lean Agile Organization
Agile Marketing
Agile Israel Events
Agile Project
A Kanban System for Software Engineering
Enterprise DevOps
RTE
Software Development
Nexus and Kanban
Scrum and XP
Amdocs
Agile Program
Kanban Game
Daily Scrum
Test Driven Development
Kanban
Spotify
PI Objectives
Story Slicing
Agile Exercises
Sprint Retrospectives
Certified SAFe
Nexus and SAFe
Lean Agile Leadership
The Agile Coach
Agile Project Management
Managing Risk on Agile Projects
Lean Agile Basics
Professional Scrum with Kanban
Games and Exercises
Software Development Estimation
Agile Techniques
Professional Scrum Master
SAFe
Agile Games
Rapid RTC
Tools
Hybrid Work
Releases Using Lean
BDD
agileisrael
Agile and DevOps Journey
Built-In Quality
Agile Community
Scrum Primer
Agile Mindset
Team Flow
Scrum.org
LPM
ALM Tools
Development Value Streams
speed at scale
Keith Sawyer
Jira Cloud
Planning
Risk Management in Kanban
Perfection Game
Agility
Agile India
Nexus vs SAFe
Scrum Master
Scrum Values
ATDD
Continuous Planning
WIP
Covid19
Continuous Integration
Professional Scrum Product Owner
What Is Kanban
Agile Testing Practices
Portfolio for Jira
Operational Value Stream
System Archetypes
Agile for Embedded Systems
Atlaassian
lean agile change management
Implementation of Lean and Agile
Agile Assembly Architecture
Entrepreneurial Operating System®
Principles of Lean-Agile Leadership
Sprint Planning
SAFe Release Planning
An Appreciative Retrospective
Engineering Practices
AI Artificial Intelligence
Lean and Agile Principles and Practices
Product Ownership
SA
Achieve Business Agility
Advanced Roadmaps
Scrum Master Role
Agile Games and Exercises
IT Operations
chatgpt
Continuous Deployment
Lean Software Development
AgileSparks
Logo
Enable registration in settings - general

Contact Us

Request for additional information and prices

AgileSparks Newsletter

Subscribe to our newsletter, and stay updated on the latest Agile news and events

This website uses Cookies to provide a better experience
Shopping cart