Category Archives: Programming

Struggling to become a DevOps engineer

Sometimes when I am cooking, a bored kid asks:
“How can I help?”
My answer is:
“You can cut the vegetables.” Or
“You can stir in the pan.”

When my kids were smaller, they loved to make pizza. And even small hands are handy for peeling off the brown layers of an onion.

Pair programming

The Test column was empty for a few days and I had finished all preparations for the items in progress. Was there a way that I as a tester could help the DevOps engineers?

“We can do pair programming.”
I was all ears and eyes. So I joined a programmer while he was coding. Once in a while he said his thoughts aloud.

“Okay, now it is your turn.”
I looked at the DevOps engineer expectantly:
“What do I have to do?”
“Programming”
“I mean: what must I program?”

A short dialogue followed. My knowledge of the development environment was almost zero and I did not know everything about Java.
“You better take a course at Pluralsight.”

Pluralsight and Java

In this company every DevOps engineer and the tester (that’s me) had access to Pluralsight. Courtesy of the employer. Pluralsight is an online course platform with a massive load of courses.

“There is a test to determine how good you are.”
Sure no problem.

A line graph is shown with three different colours: orange for beginners, green for proficient, and blue for expert. There is a green circle "Skill IQ 135" in the green line, which is connectd to a vertical line with "40th percentile" at the foot!"

A lot of readers might think:
“Wow, I would hire Mindful Tester.”
Sorry gals and guys. Up to 40% of all people got this level. This basically means that 2 out of 5 people knew as much about Java as me. Not enough to make complex changes.

Now Pluralsight had another nice feature called learning path. So I dutifully cruised through the courses. I had the advantage of two screens, so I could play the course on 1 screen and program on the other 1.

I had some doubts about the courses. It was like a typing course. Just enter the text and you have a working program. Tada.

Another doubt was the absence of Test Driven Development. I shared my concern with a bright DevOps engineer. He reassured me:
“First focus on the language, then the rest will come.”

The same engineer noted the lack of challenge, so he referred me to project Euler. This free online platform had mathematical / programming problems. Afterwards he reviewed my Java code, which I really appreciated.

Java is great, but my team used more tools to develop programs. So I followed courses on Spring and Maven.

At the end of the course I could get some certificate. With no real practice I had some knowledge. On the other hand my experienced DevOps engineers loved Pluralsight. They set the video speed to double speed and picked up their nuggets of knowledge.

HTML, CSS, and JavaScript

“I noticed that you focused on layout.” my scrum master said.
“We need someone who can design good interfaces. Maybe you should focus on the front-end.”

In this company the front-end was a website. So I had to study HTML or HyperText Markup Language, the basic programming language of web pages. I was familiar with HTML. <b> hello </b> is shown as hello. b is short for bold.

I picked a Pluralsight course for advanced web development. This was both horrifying and clarifying.

So I should have basic JavaScript and CSS knowledge. I picked a course with JavaScript: CSS was needed. I switched to CSS. Only HTML was needed. Phew.

What is CSS or Cascading Style Sheets? In my own words it is a way to style a website in s consistent style. E.g. all the buttons look alike and the web page can respond to different screen sizes.

I followed two courses of CSS. They were practical, so I was able to modify the look and feel of a website without changing the functionality.

Next stop on Pluralsight was JavaScript. In my own words this language is used by browsers on the computers or mobile phone of the users. This programming language basically reduces the traffic between the front-end (e,g, website) and the back-end, where the important things happen like handling a payment.

I was lucky again. There were some basic courses which gave me some practice with JavaScript.

If I look at Pluralsight there are some good courses, but it took time to find them.

Edx.org

The biggest disadvantage of Pluralsight was no examination. My scrum master found an interesting alternative, edx.org.

You could call it freemium. The course and examination are free, but you have to pay a premium for the certificate.
Freemium is “free premium” without ” pre”.

I picked HTML5. The course was for beginners. But I was really happy with all the Pluralsight knowledge obtained. The course gave me a good insight in HTML5, but it also showed its limitations.

Next certificate was CSS Basics. Again I had an advantage and obtained enough points for a certificate.

ReactJS should be possible with my basic knowledge of JavaScript. In my own words ReactJS is a language, which can better interact with users than HTML5. The course was tough and I dropped out.

Edx.org and Pluralsight

Edx.org had the same choice problems as Pluralsight. I had to follow course parts to determine whether there was a click.

A major difference is, that Edx.org courses are time bound. After a deadline the course is closed and only accessible for old students of this particular course.

Edx.org has a slight advantage that it offers up-to-date information. Pluralsight has some old courses. For a Maven course this is tricky. Old versions as shown in the video cannot be used.

Another deadline disadvantage of edx.org is that timing is personal. Several courses acquire 2 hours a week. For someone new to coding this number is too low. Sometimes one block of 2 hours would take me 40 hours. There is also a deadline for a certificate. My advice is first to get the required numbers of points and then buy the certificate.

Once I bought a discounted certificate before getting the required points. Let me write it was not my best investment. There are limitations to be aware of.

Security, privacy, and usability

A DevOps engineer does more things than programming. So I learned about website security, privacy laws, and usability.

In the meantime I acquired some DevOps skills like looking in and understanding log files.

Status update

In April 2018 I got the disturbing news, that I was fired.
No bingo for me.

In case you want to know what I am doing right now.

Thanks for reading. I really appreciate it. Cheers.

Other online courses

This year Trish Koo asked for some online programming courses In the answers there are some online platforms I will try the next time.

Being Sidetracked – Part 5

Just a few sections to end this blog post serie.

Just store it somewhere safe

Now I had a few productive days. I could easily do Test Driven Development with the help of the junior DevOps engineer. But I left out one important step in the development: the use of the version control system.

Looking at the numbers I think that Windows 10 is better than Windows 8.

One of the advantages of version numbers is that I know which platform the user used. And which version I have to use to pinpoint a problem in production. Versions are great for code.

Writing code is like making a story for a movie. If I made an error, then I reverted the change using Undo. Most of the time several people are involved for making the same movie story. There are a lot of people willing to pay 8 $ for a good movie. Coming soon to this cinema

Let’s take an imaginary superhero movie. Pete knows a lot of action scenes. After a while he describes a scene to the other crew members:
“And then she flies in the air.”
“Sorry Pete, but Lightning Buzzword Angel cannot fly.”

“But she is called Angel and angels can fly.”
“You’ve got a point, Pete. But not every woman called Angel can fly.”
“So I have to rewrite the whole scene.””
“Sorry dude.”
“It took me weeks to figure out this scene.”
“It is great, but we have to stick to the character.”

“So you just have to start from version 0.3 of the Supermarket Fight Scene.”
“But I also changed the First Car Ride Scene and the Milkshake Scene because of the bruises made by Oval Owl.”
“Wait, you say bruises.”
“Yep.”
“But then I have to rewrite my scene.” Amy remarks.
“And I the Milkshake Scene.”, another writer joins in.

Making a story for a movie is like writing code. If a programmer or DevOps engineer changes a method or function, then this can have severe consequences for the code. The trick to detect faulty code as early as possible. There’s absolutely nothing wrong with that.

Using Test Driven Development or TDD in a proper way a DevOps engineer knows that the added code is right.
Using a version control system she or he can merge the added code with the code in the repository. The result of all unit tests for this file is an early indicator for the quality.
Then the integration tests would be added, merged, and executed.

Now comes the most interesting part. If a release was made in this particular company, all unit tests and integration tests for the whole code were executed. All the tests from previous TDD or Red Green Refactor cycles were reused again. Of course some tests would fail, but the DevOps engineer would set things right. This could be the code or the test or both. And yes, this could lead to refactoring or restructuring code with an eye for maintenance.

After a few days of TDD a new file could be checked and processed in case of positive checks.

Just me and the code

During the coding the DevOps engineer mentioned the Boy Scout’s Rule. Now we were not exactly hiking. Not especially with a flatscreen attached to a laptop. The rule basically states that I should leave the place cleaner than when I came. If I found some rubbish, then I would have to put it into a bin.

In case of software it is all about refactoring and adding missing tests. And that was the case. Missing tests could be considered as technical debt. Yes, tests are technical.

There were still some unit tests missing for other input files. And then old patterns emerged again. I started to write Gherkin files and the DevOps engineer was making them operational. After a few days he started to work on a high prio task and I was still fabricating unplugged unit tests. Then I had to turn my attention to a high prio work item. I put all the unit tests in the version control system and almost forgot them.

Just plug and test

“This takes a few weeks.”
This was the initial thought from my scrum master after the request to plug in the remaining unit tests.

Okay, rhyme after me:
I was high
on supply.

There was one simple way to change his view. I put in the whole file with unit tests and the tests were not executable. So I cut a few times until I had only one simple test left over. It was still not usable.

I needed a default input file. My scrum master agreed:
“It takes some time, but it is worthwhile.”
I slowly assembled a file over a few thousands bytes character by character using an ASCII editor. This took a big chunk of one business day. Then I could code to run my first unit test. And I got a successful test, Green.

I slowly added the other unit tests. I was quite pleased with myself until I had a failing test. Red. This must have been a programming error. I checked the knowledge management system. I was right. Next result of the same test was again Red. Of course, because I did not change it a bit. Pun intended.

I slowed down to a crawl. According to the knowledge management I was right. This time I checked the value character by character. Hmm, time for a chat with the Product Owner.

He listened to my story and told me, that my test was right. So I updated the Knowledge Management System. At last a succeeding test. Green.

This happened a few more times.

That’s it?

This serie described my experiences with Test Driven Development or TDD. For me it was often difficult to stick to Red Green Refactor.  I made a lot of errors on my way. These things can happen. Even for experienced testers there are a lot of chances of being sidetracked.

Being Sidetracked – Part 4

Some readers might have noticed that Gherkin is used for unit tests. And this might be strange or unsettling. For me it was normal. In this company the DevOps engineers worked that way. It worked, so as a tester I had to put in more effort to find bugs. Sure no problem.

Me programming

My first action was to write a test to check a business rule for a valid observation date. While I was typing, the Integrated Development Environment aka IDE suggested several options like a search engine like Google. But observation date was not known. So this sentence was highlighted in red. Syntax highlighting is also handy in programming. I don’t mind that at all.

With the help of the DevOps engineer I wrote code in Java, so the IDE could use observation date in Gherkin. The code could be executed, but the test failed. Hey that was bad.

“Now I write the code.” was my next thought.
Of course there was no code, so the test should fail. Definitely Red.
This would be fun.

I had to program in Java and I remembered that the junior DevOps engineer had some useful shortcuts. I looked in the IDE and found the option in a sub menu to add a method. I gave it a name and – yes – I got an empty method in the right class. Now I had to fill in the blanks.

Me writing Gherkin

Months earlier I had written several Gherkin unit tests in the knowledge management system. There were two things wrong with this approach. The tests were not used, so I was high on supply. In plain English I had made something which was not used. On a scale of time it was a waste of time.

The other thing was that it had a web interface. The syntax highlighting did not work. I could make things bold and indent texts, but that slowed me down too much.
The result, the code, was not easily readable.

The dates were in the following format DDMMYYYY. This is programmer s’ language for Day in 2 numbers, followed by Month in 2 numbers, and finished with Year in 4 numbers.
So April 1st 2001 would be written down like 01042001. 01 is the first day of month number 04, which is April. 2001 is of course the year. It is easy to pick good dates like

  • 01042001 (first day of the month),
  • 31032013 (last day of the month), and
  • 29022000 (leap day).

I picked some wrong dates on more rational grounds:

  • 07142011 (for the Americans July 14th 2011),
  • 20132007 (20th day of the 13th month), and
  • 1jan1998 (January 1st 1998 in a hydrated date format.).

After writing date tests for one date field I noticed a pattern. I would check on all these dates again for other dates like expiration date. I thought I was smart. I just copied all the observation date tests and replaced ‘observation date’ by ‘expiration date’. I even copied the tests to a special text file, so I could save time. But I was wrong!
Please read on.

Me at the keyboard again

So I was programming unit tests and on my side was a junior DevOps engineer assisting me. I could finally write a test in Gherkin. In a separate window I opened the knowledge management system. I picked the first right date 01042001.
“Why do you pick this date?”, my personal DevOps engineer informed.
“I want to be sure that the right date is accepted.”
A nod followed by:
“We use Joda-time for that.”

I heard: “Yoda time”
It was not possible for me to link a lightsaber wielding big pointed eared green creature with programming.
“Joda-Time checks on valid dates, so you do not have to test them.”
Java 7 was not safe enough for dates and some programmers made Joda-Time. That saved me a lot of time.

So I only had to test on the wrong dates. Easy. I added tests, which succeeded. Green.

There was a `but` coming up.
“You can skip that date.”, while the DevOps engineer referred to ‘1jan1998’.
“Characters are not allowed in the date. ”

The next morning the DevOps engineer showed me a neat table:

Given the file has observation date <date>
When the file is read
Then the file will not be processed


Examples:
| date     |
| 07142011 |
| 20132007 |

He had improved the test code considerably. Refactor. I forgot to use DRY, Don’t Repeat Yourself.

My scrum master said that it was important to know how to program. This way I could structure my tests in a good way.
But the worst was still to come.

To be continued.