20
Continuous integration and good testing practices while coding 1 12/10/2016 © Nokia 2016 Presentation for TTY course Ohjelmistojen testaus Tuomas Lunti

Continuous integration and good testing practices while codingtie21201/s2016/luennot/vierailuluennot/Automated_S… · Continuous integration and good testing practices while coding

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Continuous integration and good testing

practices while coding

1 12/10/2016 © Nokia 2016

Presentation for TTY course Ohjelmistojen testaus

Tuomas Lunti

Nokia Networks business in Finland

2 12/10/2016 © Nokia 2016

Networks business in Finland

• Head office in Espoo; other offices in

Oulu and in Tampere

• One of the main R&D locations for

Networks

• Full range of operations including

manufacturing of base station

products in Oulu

• Key customers: Nationwide

operators Elisa and TeliaSonera;

Finnish Railway Administration

(GSM-R)

3 12/10/2016 © Nokia 2016

Employees

• 6000 employees

•Over 10% of total Nokia employees

• 3700 R&D employees

• Approximately 400

manufacturing employees

• Employees by location:

4 12/10/2016 © Nokia 2016

•Espoo 3 000•Oulu 2 300

•Tampere 700

Locations

Espoo

•Head office functions

•End-to-end Mobile Solution Center

Oulu• Radio Research & Design Center

•Base Station manufacturing

Tampere•End-to-end Network Operability Center

5 12/10/2016 © Nokia 2016

Ecosystem• Local universities providing access to latest technologies which

utilized via coop projects and thesis workers for our R&D projects

• Lots of user experience and process automation expertise

in local companies. Coop projects with TUT, UTA, TAKK and TAMK

• Close, regular and trustful relationship with Tampere City officials and

mayor to discuss the future plans mutually. Visible e.g. via Tampere

spirit Training where public funding available

Highlights

• End to end Operability, User Experience and Process Automation

• Operations SupportSystems

• GSM Base Station Controllerand WCDMA Radio NetworkController

• SW maintenance services

• Real-time data processing for CEM via Traffica

• Shared Reference Network lab and Global OSS Lab

Technology Expertise

• System integrationcompetences for OSSandend-to-end operability

• Customer experience management,Traffica, Service assurance

• GSM / WCDMA Controller Specification, SW and I&V

• System Modules, System onChip development

Tampere –SoC Development, Operations Support Systems and Customer Experience Center

6 12/10/2016 © Nokia 2016

Continuous integration

7 12/10/2016 © Nokia 2016

NetANctetAct(regional)

General Architecture in NetAct

3RD party tool

Other

vendors

NEs

Alarms

Configurations

Measurements

GSM

WCDMA

LTE

MVI

CORE

Global products(e.g. Advanced Configurator,

iSON Manager)

3RD party tool

8 9/11/2016 © Nokia 2016

Continuous integration (CI) is a

practise where all developers

merge their working branches to

main branch at the end of the day.

This ensures integration problems

are found faster and no large

integration problems can arise.

Continuous integration

9 9/11/2016 © Nokia 2016

Code creation and testing before commit

Create/refactor

code

Create unit

testing

Review code

with team

member

Development team +

architect(s)

iterative

processTest code by

locally building or

debugging in IDE

10 9/11/2016 © Nokia 2016

Build server

Unit testing – Junits – first level of regression testing Building the software

Running static analysis tools to check code quality.

Review code in review tools.

Gerrit: https://www.gerritcodereview.com/

Free build server tools

Build server: https://jenkins-ci.org/

Static analysis tool: http://www.sonarqube.org/

11 9/11/2016 © Nokia 2016

Front end

Unit testing

Unit tests are most important test cases

Unit tests gives fast feedback to developers normally in seconds

Unit tests can be executed already in local environment

Unit tests are stable if done in correct way

Unit tests should test unit ie classes.

Static analysis

Keeps the code in good shape

Sometimes finds potential problems like null pointer issues

12 9/11/2016 © Nokia 2016

About unit testing and static analysis

Integration testing pipe is constructed on many blocks to help locating

problems easier and faster.

Examples of test automation frameworks:

https://cucumber.io/

http://robotframework.org/

Automated Integration testing

13 9/11/2016 © Nokia 2016

14 12/10/2016 © Nokia 2016

Testing practices while coding

About bugs

16 9/11/2016 © Nokia 2016

Every programmer creates bugs when coding. But testing can catch the bugs

before those go to customer.

Some reasons for bugs:

• The code has some software bug

• The code is not working as specified

• Customer environment is different than thought

• The code is used in different context than tough

• The code is used with different input than tough

• Someone else has modified the code and broken some implementation

• The installation of the software has not worked

Before and after commit

16 12/10/2015 © Nokia 2014

• Make the units.

• Read requirements one time more. Go trough them with team mate if needed.

Make units to cover those.

• Review the code with team mate if needed.

• Review the code with static analysis tool.

• Test the code by deploying it to target environment. Test manually the use cases

that those work.

• Ready to commit

• Follow the continuous integration pipes that those work

• Implement black box testes if needed

Test driven development

16 9/11/2016 © Nokia 2016

Make code which easy to understand

15 9/11/2016 © Nokia 2016

• Don’t make spaghetti code.

• Write code so its easily to understand. Use good names for

functions and classes.

• Break the code into small-enough classes and functions that

everyone can easily understand what they do.

• Remember to use single responsibility principle.

• Don’t use two fancy things which are hard to understand for

team members.

Summary and Q&A

18 9/11/2016 © Nokia 2016

Summary and Q&A

19 12/10/2016 © Nokia 2016