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:

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