by Paweł Panasewicz
pawel.panasewicz(at)gmail.com
@pawelpanasewicz
github.com/PawelPanasewicz
... actually ...
ScaLAB Conference, 2016 Wrocław
val analyst = //there was an analyst
Analyst(whatLearnt = Set()) //at the beginning he knew not a lot
.copy(whatLearnt = Set(UML, SQL, XML)) //but in time he's achieved skills
analyst
.changeYear(_ + 5) //... few years later
.`are my skills still up to date` //?
//👍 All Skills Up To Date
val manager = //there was a project manager
ProjectManager(whatLearnt = Set()) //at the beginning he knew not a lot
.copy(whatLearnt = Set(GantChart,
ManagingStyles.visionary, WritingSolemnEmails,
ManagingStyles.commanding)
) //but in time he's achieved skills
manager
.changeYear(_ + 5) //... few years later
.`are my skills still up to date` //?
//👍 All Skills Up To Date
val developer = //there was a software developer
Developer(whatLearnt = Set()) //at the beginning he knew not a lot
.copy(whatLearnt = Set(
Slick1, Slick2, Spray1, Angular1, play1,
`play < 2.5`, `your favourite example of not to old tech`
)) //intelligent beast has learnt a lot
developer
.changeYear(_ + 5) //... few years later
.`are my skills still up to date` //?
// 😕 Well Not Really
in order to deliver high quality sofware and be safe
In general
In particular
In particular
Code testing is all about writing another code which will satisfy needs mentioned in the "Why" section
In general
In particular
code code code code code ... code code code code code
these kind of codes are tested by integration tests
these kind of codes are tested by unit tests
one big integrated code
perfect undivided unit of code
E2E, System Tests
Acceptance, Functional, UI
API Tests
Component,
Isolated UI,
Just Unit Test
- tests are performed when application is deployed on environment
- tests are performed during builds and development
Acceptance/Functinal tests
Unit tests
ensure that piece of code works according to developer's design
do not assure that developer's design is in accordance with business requirements
Acceptance/Functinal tests
Unit tests
BTW There are two devs delegeted to this task
Let's assume that we are using ScalaTest , and somehow there are imported testing goodies like HttpClient and nextFreePort() ...
Hmm, a little bit red, let's create the simplest implementation
green
great success !
red
red
red
"table of contents"
private guts in descendent order of importance
red
and test routine may look like this:
- Chris Agmen Smith - autor of Petswood
Choose system, provide date string, click submit. There should appear message "working day" or "holiday" i n gray area. (sorry for typos)
it's ugly, unreadable
Questions?