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:

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