Slide 1

Slide 1 text

adesso lectures Software Development in Practice

Slide 2

Slide 2 text

01.01.2019 Software Development in Practice 2 Who‘s Talking?  Tom Hombergs  Team Lead & Software Architect at adesso AG  Java Blogger at reflectoring.io  Editor at baeldung.com  Organizer of Java User Group Dortmund hombergs@adesso.de github.com/thombergs

Slide 3

Slide 3 text

01.01.2019 Software Development in Practice 3 What we‘re trying to avoid…

Slide 4

Slide 4 text

01.01.2019 4 Process Models

Slide 5

Slide 5 text

Waterfall 01.01.2019 Software Development in Practice 5 Requirements Analysis Design Development Test Operations

Slide 6

Slide 6 text

V-Model 01.01.2019 Software Development in Practice 6 Requirements Specification System Specification Module Specification Software Architecture Coding Unit Tests Integration Tests System Integration Acceptance Tests

Slide 7

Slide 7 text

Scrum 01.01.2019 Software Development in Practice 7

Slide 8

Slide 8 text

Best Practices – Process Model 01.01.2019 Software Development in Practice 8  Start small.  Adapt the process model to your Needs.  Get feedback early & regularly.

Slide 9

Slide 9 text

01.01.2019 9 Task Management

Slide 10

Slide 10 text

Use Cases 01.01.2019 Software Development in Practice 10 Compose Blog Post Publish Blog Post Update Blog Post Publish on Social Media Subscribe Author Reader

Slide 11

Slide 11 text

Work Breakdown Structure 01.01.2019 11 Software 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

Slide 12

Slide 12 text

Slicing of Tasks 01.01.2019 12 Software 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 - The Wrong Way

Slide 13

Slide 13 text

Slicing of Tasks – The Right Way 01.01.2019 13 Software 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

Slide 14

Slide 14 text

Best Practices – Task Management 01.01.2019 Software Development in Practice 14  Use a tool!  Adapt the tool to fit your needs.  Break features into tasks at the latest possible moment.  Slice tasks vertically.

Slide 15

Slide 15 text

01.01.2019 Software Development in Practice 15 Github Demo – Task Management

Slide 16

Slide 16 text

01.01.2019 16 Version Control

Slide 17

Slide 17 text

Where to put Source Code? 01.01.2019 Software Development in Practice 17 Local Hard Drive Code Network Drive Code Local Hard Drive Code Local Hard Drive Code Editing Conflicts!

Slide 18

Slide 18 text

Version Control 01.01.2019 Software Development in Practice 18 Local Hard Drive Code Version Control System Code Local Hard Drive Code Local Hard Drive Code

Slide 19

Slide 19 text

Branching 01.01.2019 Software Development in Practice 19 First Commit Start 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

Slide 20

Slide 20 text

Advanced Branching 01.01.2019 Software Development in Practice 20 http://nvie.com/posts/a-successful- git-branching-model/

Slide 21

Slide 21 text

Best Practices – Version Control 01.01.2019 Software Development in Practice 21  Use version control!  Provide meaningful commit messages.  Don‘t keep unnecessary code.

Slide 22

Slide 22 text

01.01.2019 Software Development in Practice 22 Github Demo – Version Control

Slide 23

Slide 23 text

01.01.2019 23 Documentation

Slide 24

Slide 24 text

Document Requirements 01.01.2019 Software Development in Practice 24  Document 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

Slide 25

Slide 25 text

Document a Goal 01.01.2019 Software Development in Practice 25

Slide 26

Slide 26 text

Document a Use Case 01.01.2019 Software Development in Practice 26

Slide 27

Slide 27 text

Document a Single Requirement 01.01.2019 Software Development in Practice 27

Slide 28

Slide 28 text

Document Architecture – The arc42 Template 01.01.2019 Software Development in Practice 28 1. Introduction & Goals 2. Constraints 3. Context 4. Solution Strategy 5. Building Blocks View 6. Runtime View 7. Deployment View 8. Concepts / Patterns 9. Design Decisions 10.Quality Scenarios 11.Technical Risks 12.Glossary www.arc42.de

Slide 29

Slide 29 text

Document Architecture – The arc42 Template 01.01.2019 Software Development in Practice 29 1. Introduction & Goals 2. Constraints 3. Context 4. Solution Strategy 5. Building Blocks View 6. Runtime View 7. Deployment View 8. Concepts / Patterns 9. Design Decisions 10.Quality Scenarios 11.Technical Risks 12.Glossary www.arc42.de

Slide 30

Slide 30 text

Document Architecture – Context 01.01.2019 Software Development in Practice 30

Slide 31

Slide 31 text

Document Architecture – Building Blocks 01.01.2019 Software Development in Practice 31

Slide 32

Slide 32 text

Document Architecture – Example Patterns 01.01.2019 Software Development in Practice 32  Transactions  Logging  Exception-Handling  Unit-Testing  Integration-Testing  Security  Coding Conventions  Internationalization  Scalability  High Availability  Buildmanagement  Database Access  Migration  Session Handling  User Interface  … www.arc42.de

Slide 33

Slide 33 text

Best Practices – Documentation 01.01.2019 Software Development in Practice 33  Document as little as necessary.  Treat documentation as you would source code.  Use a markup language.

Slide 34

Slide 34 text

Best Practices – Documentation 01.01.2019 Software Development in Practice 34  Document specifically for each stakeholder group.  Update documentation when a task is done, not when the project is done.  Documentation is a team effort.

Slide 35

Slide 35 text

01.01.2019 Software Development in Practice 35 Github Demo - Documentation

Slide 36

Slide 36 text

01.01.2019 36

Slide 37

Slide 37 text

01.01.2019 37 Testing

Slide 38

Slide 38 text

01.01.2019 Software Development in Practice 38 Testing Pyramid Unit Tests Integration Tests End to End Tests Manual Tests

Slide 39

Slide 39 text

01.01.2019 Software Development in Practice 39 Test Coverage != Test 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

Slide 40

Slide 40 text

01.01.2019 Software Development in Practice 40 Test Coverage != Test 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

Slide 41

Slide 41 text

Best Practices – Testing 01.01.2019 Software Development in Practice 41  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.

Slide 42

Slide 42 text

01.01.2019 42

Slide 43

Slide 43 text

01.01.2019 43 Continuous Integration

Slide 44

Slide 44 text

01.01.2019 Software Development in Practice 44 Modular Software Development Blog Post Management Visitor Statistics Social Media Integration E-Mail Notification

Slide 45

Slide 45 text

01.01.2019 Erfolgsfaktoren in der Softwareentwicklung 45 CI Pipeline

Slide 46

Slide 46 text

Best Practices – Continuous Integration 01.01.2019 Software Development in Practice 46  Separate concerns in separate modules.  Automate your build process.  Run unit tests and integration tests in the build process.  Build regularly.

Slide 47

Slide 47 text

01.01.2019 Software Development in Practice 47 Github Demo – Continuous Integration