Hombergs Team Lead & Software Architect at adesso AG Java Blogger at reflectoring.io Editor at baeldung.com Organizer of Java User Group Dortmund [email protected] github.com/thombergs
Project Compose Blog Post Display WYSIWYG-Editor Save Blog Post to Database Add Blog Entity to Database Publish Blog Post Display WYSIWYG-Editor Save Blog Post to Database Add „Published“ Field to Blog Entity Update Blog Post Display WYSIWYG-Editor Save Updated Blog Post to Database Add „Updated“ Field to Blog Entity Social Media Integration Publish to Facebook Publish to Twitter Subscribe Send E-Mail on new Blog Post Send E-Mail on updated Blog Post
Project Compose Blog Post Display WYSIWYG-Editor Save Blog Post to Database Add Blog Entity to Database Publish Blog Post Display WYSIWYG-Editor Save Blog Post to Database Add „Published“ Field to Blog Entity Update Blog Post Display WYSIWYG-Editor Save Updated Blog Post to Database Add „Updated“ Field to Blog Entity Social Media Integration Publish to Facebook Publish to Twitter Subscribe Send E-Mail on new Blog Post Send E-Mail on updated Blog Post - The Wrong Way
Development in Practice Blog Project Compose Blog Post Display WYSIWYG-Editor Save Blog Post to Database Add Blog Entity to Database Publish Blog Post Display WYSIWYG-Editor Save Blog Post to Database Add „Published“ Field to Blog Entity Update Blog Post Display WYSIWYG-Editor Save Updated Blog Post to Database Add „Updated“ Field to Blog Entity Social Media Integration Publish to Facebook Publish to Twitter Subscribe Send E-Mail on new Blog Post Send E-Mail on updated Blog Post
of a feature branch. These changes must not go live in version 1.0! Version 1.0 goes live! Hotfix for a bad bug. The bug disrupted work in the feature branch, so it got merged. Version 2.0 with the new feature goes live Code Review before merging
Goals Document Use Cases Document Requirements Requirements further specify Use Cases Use Cases contribute to a Goal Pohl und Rupp, Basiswissen Requirements Engineering, dpunkt Verlag, 2015
Document specifically for each stakeholder group. Update documentation when a task is done, not when the project is done. Documentation is a team effort.
Quality @Test public void testAbsoluteSum(){ Calculator calculator = new Calculator(); assertThat(calculator.abslouteSum(-1,2)).isEqualTo(3); } public class Calculator{ public int absoluteSum(int a, int b){ return (a < 0 ? -a : -a) + (b < 0 ? -b : b); } } 100% Line Coverage, 1 Bug missed
Quality @Test public void testAbsoluteSum(){ Calculator calculator = new Calculator(); assertThat(calculator.absoluteSum(-1,2)).isEqualTo(3); assertThat(calculator.absoluteSum(1,2)).isEqualTo(3); assertThat(calculator.absoluteSum(-1,-2)).isEqualTo(3); } public class Calculator{ public int absoluteSum(int a, int b){ return (a < 0 ? -a : -a) + (b < 0 ? -b : b); } } 100% Line Coverage, bug is flushed out
Write unit tests! Write tests when a task is done, not when the project is done. Don‘t aim for meaningless test coverage percentage. Review one another‘s Ccode. Manually test one another‘s features.
46 Separate concerns in separate modules. Automate your build process. Run unit tests and integration tests in the build process. Build regularly.