Monday, July 11, 2016

Using SonarQube in a Shared Docker Image to simplify Java code quality testing for teams - Part 1

As teams work to increase their speed to production, a discussion about code quality will inevitably come up. 

In many cases, development team members (even with production level tools in place) have difficulty checking code quality before checking code into a shared repository and have to wait to see results. 

This article seeks to provide a method to allow code quality checks using SonarQube to happen on the development station before having to check to the code into a code repository while also providing a consistent base Plugin­ set for team members. 

Although the procedure below gives a base set to start with for Java developers, it is provided as a guide to allow you to use a similar approach and build something that is perfect for your unique environment.

This is the first of several posts.

Part 1 - A Quick-Start to using SonarQube and docker on a developer workstation with no long-term data retention 

Part 2 - An extension of this procedure to a cloud based server (such as Digital Ocean) 

Part 3 - Some notes about storing data long-term into a database.

Important Notes:​


The Quick-Start procedure in this document launches a container on a workstation that is disposable and will not retain any data if re­-created.  
  
An understanding of docker installation and execution is implied.

Please consider firewall implications as source code may become available at port 9000 at your workstation.


Technology used:




Article Sections 

  • Quick­-Start (development station) 
  • Sample launchable Dockerfile and image


Quick-­Start 


Using the shared Droplet instance from your workstation


docker run -d --name sonarqube -p 9000:9000 mikecaspar/docker_sonarqube

You should see the latest image download .... 




You will be able to confirm the server is running with the command: 

docker ps


It should show you something like this ... 



Notice that the SonarQube server starts at tcp port 9000.  You may need to make firewall adjustments. 

To get the local server to see it’s current information, use the Url: 

http://localhost:9000


The default SonarQube instance will look like this:  






* Notice the red warning that data stored in this instance will not stay in the server after it has been restarted. 


To add your Java project to the local instance for current code quality information, go to your Java project directory (where you POM file is) and type: 


mvn sonar:sonar


By  default , the Sonar plugin looks for a local Sonar Server to store data. 

The sonar plugin will download from your configured sources, analyse your code with the currently configured rules and then store the results in the current temporary instance. 



Now, you can see your progress without the need to check your code into a repository first!


Go back to your web instance at http://localhost:9000 and you will see how your code quality is. 

This sample has a few hours of technical debt shown for presentation purposes ... 





 A more detailed view.. 





Sample launchable Dockerfile and image 


A sample Dockerfile is available at this git repository:  

https://github.com/MikeCaspar/docker-sonarqube

This repository could be used as is to launch containers without the need to create your own if you are happy with the settings in the repository. 

If you to make your own changes, feel free to fork or clone the repo.


The Dockerfile is available at  

https://raw.githubusercontent.com/MikeCaspar/docker-sonarqube/master/Dockerfile 

The default admin userid is ​admin​

The default admin password is ​admin​




Thursday, July 7, 2016

Self-driving vehicles and test code coverage


As many of us know, a world of self-driving vehicles is coming quickly. These vehicles do this with computer software.

I'd like to share a thought with others to start a discussion.

I generally hesitate to ask for rules and procedures, but in this case, I feel our lives may depend on it.

Should we ask auto-manufacturers to provide some kind of metric about source code test coverage as a percentage for the self-driving portion of the source code?

I acknowledge that 100% test code coverage does not guarantee reliable software. I also feel personally certain that I don't want a vehicle driving me around that has no Unit Tests or automated tests as part of the development, build and test process.

I have seen too much in my career to expect this to be safe.

Why do I bring this to people's attention now?

Many people do not know that there is an ongoing discourse in the software industry relating to the delivery of features versus appropriately testing software. I won't talk about this here. Do an internet search on "Extreme Programming" or "Test Automation" as a place to start. You'll see how important testing is to software.

It is not uncommon to hear comments in the software industry such as "Oh, it will be fine, it can go out with that bug", or "we'll fix it later", or my least favourite....

"We don't have time to write tests. 
We need to get the feature out."

Personally, I don't want to let a vehicle drive me where the developers have been pressured (or the developers have decided on their own) to write code without tests. Not all companies or developers are this way! I do not intend on painting them with a big brush.

I want to be clear.  I have zero knowledge of any vehicle manufacturer acting irresponsibly to-date. I am just thinking about my future and I don't want this topic to come up when it's far too late for myself, family or friends.

I have been in the software business long enough to know that I have a responsibility to society to bring this up now.

There's no perfect answer to appropriate code coverage with tests, Please don't get that impression. 

All I ask of you is that we find a way to not let this important conversation just disappear.
  
Letting auto manufacturers (new and old) know we care about code quality for self-driving vehicles will already go a long way.

If you are in the self-driving car business, please consider this as an important topic. Even if you disagree, I'll be happy because at least you thought about it.

I think about it this way.. I am saving my own life.  

Thursday, June 30, 2016

Leaders are not combatants. They are people too!


This post was an absolute must-send based on something I heard and experienced this week (which will remain confidential).

Do you consider yourself to be in the agile coaching business?

If so... Do you use the term "Leaders" to describe an us versus them mentality?

Really... Look inside yourself...

Leadership is important for what we do. Making them enemies if there isn't an immediate acceptance of what you perceive to be "your" cause is harmful.

In fact, it really shouldn't be "your" cause if you're being paid by those same leaders as an agile coach to help them achieve their vision. Yes, I understand there is guidance involved and sometimes the leaders need some help or to be challenged. 
boxing image by Michiyo Kurosawa
image courtesty of
Michiyo Kurosawa through
a Creative Commons 2.0
 Share-alike license

Please.. If you disagree with the leader's approach, talk to them, or step away for a break. 


Do not insult absent leaders while in the presence of their people. This most certainly causes confusion with those that you wish to help! 

Consider that your behaviour may in fact be re-enforcing a bad habit loop and creating the problem you perceive. 

You may need to stand up for what is right as part of your job. This I get.

Talking badly about a leader while coaching their teams may to some be considered unprofessional.

Why not try getting to know the leadership instead of jumping right to bashing...

Leaders ...... are people too!

Mike Caspar
Passionate About agile


Wednesday, June 15, 2016

Categorized Ideas Coaching Tool

The Categorized Ideas Coaching/Facilitation Tool is designed to help obtain common goals and ideas from people with different backgrounds or approaches to a situation.

I have been iterating on this tool for a while. Until recently, it has only been used at clients and with a few close friends.

I recently shared the tool at Agile Coach Camp Canada 2016 in Cornwall for the community as a whole.


A sample question used for this first canvas....

To all participants (as an example).

"The government has told us we have 1 month to move our business to another province.  We have 35 employees. 


I would like your help to ensure we are prepared for this and all of our thoughts and ideas are considered.  


For each  idea that you have, place it on a sticky and put it up on the board (canvas).
Feel free to talk to each other as you put them up".


- very little facilitation needed (caused by thick lines and colours)
- If necessary, could say "It might help to read each other's stickies as you put them up"


Step back. Things will take care of themselves...






A sample (real) question used for the second canvas (created by one of the participants)...

"I am worried about the future health of my family because we're all so busy.

 I would like some ideas about some possible steps and things to do to help keep our family healthy.  


We have 4 people in the family".

- very little facilitation needed (caused by thick lines and colours)
- If necessary, could say "It might help to read each other's stickies as you put them up"


Step back. Things will take care of themselves...




I have used the tool for many other types of sessions...


  • Jenkins CI session with multiple types of teams followed up with shared ideas on how Jenkins could be used in the organization
  • At a Manufacturing Company to consolidate thoughts from various departments to help prioritize plant upgrades and maintenance. 


You can share your own learning and uses for the Categorized Ideas Coaching/Facilitation Tool to this page...


Just send me the following information...


  • Name of Facilitator (with optional link to home page)
  • Name of Contributors (optional)
  • Question ? or Context ?
  • The image
  • Any specific observations you would like to share (what you learned or something we should know)

As long as it makes sense and I can keep it up, I'll add more uses for the coaching tool to the page.

To be included, simply reach out to me at  mike (-at-) caspar.com  with the following information and I'll add you to the page.

Some last comments....
  • Please make sure you the have rights to any images shared on the site
  • I will reserve the right to restrict content.
  • Images and contributions will be licensed as Creative Commons (as indicated by the page)


I hope we see many new contributions, ideas and learning.

Have fun!


Creative Commons Licence
Categorized Ideas by Mike Caspar is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Tuesday, April 12, 2016

Principles, not Principals

As some of you know, I have been volunteering for the amazing folks at Blueprint Education.

They are working to bring agile values and principles to education (at all levels.. not just students).   


Executives, Principals, Guidance counselors, Teachers, and Students are all learning to work in a team based, collaborative way. They are learning to learn together. 


I was there last year to participate in an awesome event where students volunteered to start Scrum teams to do community work and improve their school.  A link to that post here.


About two months ago I had an fascinating conversation with the Principal of one of the High Schools. She said to me... 



"Mike, we will work to run our high-school with
Principles, not Principals". 


She (as part of a Scrum Team herself), had realized that what she needed to do was to empower her teachers to be responsible for themselves and make decisions on their own without a heavy handed approach from her. She could then focus her energies on coaching others, supporting students and helping other schools in their system out.

Learning to be Agile
(c) Blueprint Education, 2016

The teachers are also using Scrum at the school level. Their Scrum board is visible to all their students. Imagine complete transparency for students as to what the teachers are doing! Then, imagine the accountability the teachers have to the students.

That's a shocker already.... but....

Then she said...  

"Mike, I am excited about this. I already talked with the teachers to make sure they were interested in having this level of responsibility and freedom instead of just telling them this was happening. I'm nervous but excited about this."  

WOW.. That's all I can say.. If you are an educator, imagine this level of empowerment and responsibility.

Of course, the teachers (who are already learning about self-empowerment for themselves and to help their students), were of course pleased and excited. They learned Scrum so they could better facilitate it's use for Students. This way, everybody is on equal ground when it comes to learning and approach to learning (or work).

Some of the Blueprint team will be presenting their progress at the Scrum Gathering 2016 in Orlando. If you are there, go by for a visit.

I know that Mark French (the CEO) or any of the Principals, Guidance counselors, Teachers, and many of the students would be pleased to tell their story. 

Here's their info...

https://www.blueprinteducation.org/agility/  

To reach out to them,  start here , or email them at  agile@blueprinteducation.org to ask to hear more.

I love what these educators are trying to seriously change the way education works and I am honoured to know them. I proudly wear my "Learning to be Agile" shirt they gave me during my last visit.

If you would like to learn a bit more about the concepts of Agility in Education, someone shared this wonderful post with me today. It might give you some insight into where they are coming from.

Please, reach out to the folks at Blueprint. They would be more than happy to share their amazing story! 

Their contact email:  agile@blueprinteducation.org


Mike Caspar
Passionate About Agile

Saturday, April 2, 2016

Selecting project delivery dates


Ask yourself....  


Is this your approach to selecting a delivery date for your project ?



Throw - courtesy of zolakoma

Should it be?


Tuesday, March 29, 2016

Inspect and Adapt versus Report and Adapt




A simple post today.... 




Yes...Just the picture today.


Download links....

PDF format

PNG format

Mike Caspar
Passionate About Agile