donal
2018-04-27 542e514006cbce5288cd3d859dda360ba0380db2
ADD top and tail for non-functionals
2 files modified
36 ■■■■ changed files
5-non-functionals-strike-back/README.md 32 ●●●●● patch | view | raw | blame | history
6-return-of-the-app-monitoring/README.md 4 ●●●● patch | view | raw | blame | history
5-non-functionals-strike-back/README.md
@@ -1,8 +1,32 @@
# The Non-Functionals Strike back
> In this exercise we explore the non-functional side of testing.
![death-star-vent](../images/exercise5/death-star-vent.jpeg)
## Exercise Intro
Non functional testing provides valuable insights into code quality and application performance. Often overlooked but usually one of the most essential types of testing, non functional testing types can include, but are not limited to
- Performance Testing
- Security testing
- Static Code analysis
- Vulnerability scanning
There are many tools out there for supporting these testing types but often they are left to the end of a delivery. Many traditional projects will leave Performance testing or security sign off to a few weeks before Go Live. This raises the question of what do we do if things do not pass these tests? Do we hold off the Go Live or accept the risk. In most cases we can learn earlier if things will be show stoppers and more importantly we can automate them.
For example; imagine a developer called `Sam` has checked in some poor performing function into an API that spikes it's response time. Let's call this `Sam Code`. This `Sam Code` may not be caught by our Unit Tests but could have very big impact on application usability. Before building code on top this and it becoming more of an issue at the end of a project; we could code and capture metrics around API response time and track these over time and hopefully spot regressions earlier.
Another one of the age old questions is "How do we know we're testing enough?". Well the simple answer is you can never do enough testing! But how do we know we are testing the right things? Code coverage metrics can be run on our application while running the tests. They can identify what files are tested and a line by line of how many times a test executes against a block of code. Reporting these metrics in our pipeline gives a greater handle on the quality of our testing.
Static code analyis can provide great insights into the quality of the code we've written. By analysing code without executing it bugs and common gotchas can be identified. Code complexity can be assessed using tooling such as SonarQube. Linting of code is a useful thing for non compiled languages such as JavaScript to execute in a build.
Integrating these tools into the developer workflow can greatly improve quality and readability of code. Putting them in the pipeline ensures they are executed - removing the _"It works on my machine"_ view some may take.
#### Why run non functional tests?
- Early identify common code gotchas and pitfalls
- Tighten our feedback loop by executing non functional tests earlier in a project lifecycle
- Improve Code readability with agreeing a coding standard and then codifying it.
- Improve trust in the code quality and bring together security teams with dev teams earlier
- They can be automated; so why not run them as part of a build!
_____
## Learning Outcomes
@@ -13,9 +37,11 @@
- Do some light performance testing to monitor throughput of APIs
## Tools and Frameworks
> Below is a collection of the frameworks that will be used in this lab
> Below is a collection of the new frameworks and tools that will be used in this lab
1. [eslint](https://eslint.org/) - ESLint is an open source JavaScript linting utility originally created by Nicholas C. Zakas in June 2013. Code linting is a type of static analysis that is frequently used to find problematic patterns or code that doesn’t adhere to certain style guidelines. There are code linters for most programming languages, and compilers sometimes incorporate linting into the compilation process.
1. [stryker](http://stryker-mutator.io/) - Mutation testing! What is it? Bugs, or mutants, are automatically inserted into your production code. Your tests are run for each mutant. If your tests fail then the mutant is killed. If your tests passed, the mutant survived. The higher the percentage of mutants killed, the more effective your tests are. It's really that simple.
## Big Picture
This exercise begins cluster containing blah blah
@@ -29,7 +55,7 @@
2. Add Code Coverage reporing to the build for gaining greater insight into test improvements.
2. Add `npm run lint:ci` to the Frontend and report the result using the Checkstyle Plugin in Jenkins.
2. Add `npm run lint` to the Frontend and report the result using the Checkstyle Plugin in Jenkins.
2. Create a new Jenkins job to run some light performance testing against the API layer using the perf tests tasks.
6-return-of-the-app-monitoring/README.md
@@ -27,10 +27,10 @@
2. Create a new Dashboard for our Builds using the plugin above. Use Regex to add jobs to it. Use the BuildFail Analyser to add meaningful data to the reason for failures.
2. Use the pipeline views in OpenShift and Jenkins to produce dashboards that teams can use.
2. Use the pipeline views in OpenShift and Jenkins to produce dashboards that teams can use.
## Step by Step Instructions
> This is a fairly structured guide with references to exact filenames and sections of text to be added. Include pictures and code snippets where appropriate. Rule of thumb is learners are dumb.... so over describe _why_ we're doing things
> This is a fairly structured guide with references to exact filenames and sections of text to be added. Include pictures and code snippets where appropriate.
### Part 1 - Create a build monitor
> _In this exercise we will create a new build monitor to show key information about our builds_