Episode V – The Last DevOps

This is the last part of a DevOps related topics series:

I’ll be talking about the previous blogposts, if you want to read them here they are:

Bring balance to DevOps culture, image from this medium post

So… DevOps?

Though the 3 previous parts, we practiced our Continuos Integration. We built and test (and did some kind of monitoring) to a central repository after “automated” builds tests are run.

“Continuous Integration doesn’t get rid of bugs, but it does make them dramatically easier to find and remove.”

Martin Fowler, another guru of software as Kent Beck

So I learned that DevOps is helpful for finding errors quicker than waiting until the end. Sometimes you don’t know the failures that might happen outside the local environment.

The Goats

Cheating a bit with Jenkins

Jenkins is a good option if you want to build at a bigger scale. This is an open source automatization server written in Java, advantages of using it:

  • Continuous integration an delivery
  • “Easy” installation and configuration
  • Has hundreds of plugins
  • Extensible and Distributed.

I know that a lot of companies use Jenkins because it makes the DevOps practices a lot easier, since it has a lot of flexibility.

But not everything is color pink. One of its advantages can be a double edge sword, the fact that is OpenSource. Therefore some issues might take longer to fix. Also the migration from an old instance to the newest is a big pain (real work-life situation).

Excise Task

By this day, I had this question twice in my Testing course exam, “What’s the deal with excise tasks?”

Excise is all the extra stuff we have to do, what it costs, or the time spent on the project. For example, buying licenses, researching, money used on testing. These tasks consume a lot of our time. I believe this is natural, that excise tasks take more time that actual revenue.

Off topic – Exam week

This post won’t have the minimum quality I would expect for my regular blogposts. But what would you expect from a post I’m writing a Friday Night/Saturday morning at 1:20am?

Taken from neatoday

I just finished all my hard exams and started to felt weird for doing nothing, so writing a post for this blog was a partial terrible? solution. I’m 100% sure this will change tomorrow morning after waking up for the first time in 6 days of sleeping ULTRA late. I didn’t left things until the end this time, but the fact that I’m a graduate candidate makes everything worse. It’s like being the guy who will kick the last penalty in a final of the FIFA world cup. A mistake can decide of whether I graduate or not.

Image taken from here

CENEVAL exam, student loans documentation, and exams week merge into a short period of time. But I have faced this kind of stress at least once every single semester during the 5 years of college and every time I have survive. I thank all my friends and family that have supported me to become the person I’m today. A person who can write a blogpost of DevOps and only speak about it for 1/3 part.

I learn basics of DevOps and realized that 90% of the time doing the code was trying to figure out why it didn’t work, therefore it was excise.

Don’t you know it’s gonna be alright?

The Beatles -Revolution

Episode IV – JUnit Awakens

Welcome back to a series of blogposts about how to set up a little server in a Linux Virtual Machine, in this post we will lean JUnit and status

if you are not familiar to the topic you can go to the first, second or third part of the series

JUnit via command line

Set up (again?)

First be sure you have Java in the machine (We did this in the last part)

Lovely Ubuntu LTS Interface

Be sure you can compile Java files

I created a class so we can see everything is working fine

Download Junit archive

Download latest version of JUnit jar file from http://www.junit.org, the easiest way in Ubuntu TLS is the wget command. (link in image description)

So type: wget https://github.com/downloads/junit-team/junit/junit-4.10.jar

Create actual tests

My Hello class was pretty much useless. So I take the example from the JUnit Team. And I created two files (these are literally copy-pasted from their repo: https://github.com/junit-team/junit4

Compile!

We have to do the command javac -cp .:junit-4.XX.jar:hamcrest-core-1.3.jar Calc^CatorTest.java (remove the XX for your version)

In my case since I have the junit-4.10.jar, I put 10

Run the test

Enter the command:

java -cp .:junit-4.10.jar:hamcrest-core-1.3.jar org.junit.runner.JUnitCore CalculatorTest

Oh lala, JUnit is running at Ubuntu LTS!

Setup status page

It’s time to do some testing with our cron jobs. First I’ll power up my server.

Remember node command doesn’t exist in our environment, instead it’s nodejs.

So then I implemented a logger in my JUnit tes for the CalculatorTest.java, based on this post of stack overflow

Logger in my test

And I also created a file watcher in my serve so when it detects that my file with the error output it writes “Build” in my readme

npm install node-watch
So sadly it just change the file when it pass, but it doesn’t push it for some reason 😦

I had a very bad time with this easy example. So I don’t wanna know about the professional DevOps (DevOperators?)

Readme Test

How could you update the README page on your repository to reflect the build status using this setup?

PyCharm feat. WWW & SmallTalk

Happy Birthday Internet!

Last week was the 30th anniversary of the World Wide Web! 🎉 This is the same year that the Berlin wall came down and sadly the last time that Liverpool became premier league champions. (yes it’s a long time ago).

So thanks to Tim Berners-Lee, inventor of the WWW, now you can be reading this post from almost any part of the world (not the building 2 from Tecnológico de Monterrey, Campus GDL internet is really bad in there). Here is a quote of him that describe his vision of the internet

Suppose all the information stored on computers everywhere were linked. Suppose I could program my computer to create a space in which everything could be linked to everything.

Tim Berners-Lee

Internet has changed our life in sooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo many ways. And I’ll show some of them thanks to a very cool site that took ✌🏻screenshots✌🏻 of old web pages, this is WayBackMachine.

Its awesome to see how internet keeps changing. In 1994 (just 5 years after the WWW was created) Pizza hut was already doing online pizza delivery. The site (image below) looks like a site that didn’t found the css file. But still it’s awesome to see how we integrate the net into our daily life.

Image taken from WayBackMachine

Simple Smalltalk Testing

Changing the topic a little lot, I’ll speak about basic small talk. This is based on this article written by Ken Beck (a guru of testing).

I answer some of the questions because there were so many of them

If you want to see my thoughts about the article directly you can download the hypothesis chrome extension.

PyCharm and PyUnit

If you have Linkedin Learning (before Lynda) a good course you can follow is this. I couldn’t find any place to leave a comment but in a form of Course Evaluation, and I also gave a like to the course.

Py Test and PyCharm

For more learning you can go to https://docs.python.org/3/library/unittest.htmlYour evidence (again screenshots) of using PyCharm with pyunit.

Episode III – The Return of DevOps (SSH & Git)

Welcome back to a series of blogposts about how to set up a little server in a Linux Virtual Machine, in this post we will lean about Github and SSH

if you are not familiar to the topic you can go to the first or second part of the series

Ensure that you have your GitHub account.

Before you start you should have a Github account.

You can follow me @kevintroko (for some reason)

Ensure that you have a repository created for testing.

If you followed the last part we had a web server created in node, we will use this. This will be our root.

Setup your GitHub two-factor authentication.

This part is a step forward process and Github explain it 100 times better than me, but I’ll explain it anyways in case you don’t want to move to another site. It’s really nothing from the other world, is more just following a series of steps:

Go tho the git setting and click in the security tab


Click the enable two factor button

Follow the steps in the site

⚠️ ⚠️ DONT FORGET TO SAVE YOUR RECOVERY CODES ⚠️⚠️

They send you a mai anyways

You are ready

Github SSH keys Setup

This is a little bit harder than the last step, the Github team explain it as well (though some commands don’t work the same for ubuntu)

ssh-keygen -t rsa -b 4096 will create a SSH key with a 4096 encryption
ssh-keygen -t rsa -b 4096 -C “put your own email”
They will ask you for the passphrase
Enter your pass phrase from the last step
It will generate the next output
eval the ssh agent
The GitHub page recommend to get the RSA key like this, but ubuntu won’t recognize natively this command, you can just cat the file instead

Ensure that you can do a git clone (use ssh) to your server from your repository.

Clone the repo with ssh as ssh://git@github.com/<your username>/<repo name>.git
Node running

Be sure to create a token because then it will not allow you to push the new data

Episode II – DevOps Strikes Back

Welcome to a series of blogposts about how to set up a little server in a Linux Virtual Machine, if you are not familiar to the topic you can a little more about in here (which is the first part of the series)

Install a Linux distribution

For this task, I chose the Ubuntu 18.04.1 LTS which runs in Virtual Box. This is the same I use for other courses (maybe this is not a good idea). If you would like to download the same Linux distribution, you can install this “old” mini iso from ubuntu.

Lovely ubuntu running in my VM

Other Linux distributions (thanks to @ken_bauer for the links) :

Install support for your development environment.

The next step you can choose the language you like the most, but for this project I will use Java. Here is a very well explained tutorial in case you want to install Java in your Linux system

Java download process example
Java in action

Next step will be to set up the Github for pushing into a git repository

git in action, this is very important for the future steps

Setup web deployment.

I decided to use Node.js as my option for the web development. Be careful because for the Linux 18.04.1 LTS the typical node command has to be instead nodejs as seen in the next example

Node js server running on local host port 8080

Setup your 

This is the trickiest part, I’d recommend to first read the first test use of Cron in case you have never used it before, in other case, then just set it up for your desired functionalities

The background may seem different because I used the ITerm with ssh access to my VM

What is DevOps?

DevOps is a hot trend lately, but it’s not a new thing. This term is becoming real popular in recent years, (just like other terms as machine learning and agile methodologies),

The graph shows in blue the search numbers for the term Devops in Google. Graph taken from Google Trends

This chart is tricky since there weren’t that many Google internet users at 2004 to 2009 but still you can see the big raise of search numbers in recent years

This one is from 2014 until 2019. (It’s funny how every 3rd week of December the search goes down 🎅🏼🎄) .

So… what is DevOps exactly? According to the Agile Admin. This term is all about agile operations and the value of collaboration between development and the operations staff throughout all stages of the development lifecycle when creating and operating a service.

Developers + Operations = ??? = profit

credits to memegenerator.com (website filled with ads)

In other words, DevOps is the cooperation between the development and operations team and the people involved in the project to have a satisfactory delivery. It encapsulates the continuous delivery, automate deployment, designing the operability and monitoring.

The DevOps and the Agile methodologies are very tied together, nevertheless, DevOps and Agile are not the same thing.

In my experience, the DevOps team is the team everyone blames when a push is made into the development or any other phase and it doesn’t work properly. They are the sysadmins or masters of /Jenkins/Travis/etc… but this is not exactly the truth. DevOps is the answer to the fast pace of the modern world technology.

Continuous integration in testing

Thanks to the continuous integration which is a part of DevOps which is based on Agile, a developer can download a source code, test, build the system and verify the test! So mistakes made by developers are caught fast. So both DevOps and System tests in agile methods share the idea of “automate builds” including the verification tests. Sadly this process takes time, so the test have to be fast!

Like all the popular stuff, some people won’t like it (either having a reason or not). DevOps is popular so… some people say it’s the same thing sysadmins been doing forever just with more ceremonies and the agile principles. But I guess DevOps is a perfect solution for software development because more than just a term is a combination of tools, values, principles and practices that allow the delivery of projects at a higher velocity.

The social side of a bug’s life

Logo of a Bugs life credited to Pixar

For this blog post I’ll use the word bug referring to either a fault/error/failure.

Jorge Aranda and Gina Venolia wrote a paper called The Secret life of Bugs.   (click here if you want to read it)In general it talks about how even simple bugs are very complicated to track with just automation, mostly because the human factor.

It’s very funny painful how sometimes when I work on a project, 40% of the time is dedicated to develop a functionality and the rest fixing the secondary effects. If this effect is a bug then I write an issue either on the repository or anything related to the project management. But here is the trick, as humans we believe we can keep track of everything in our minds, but in my experience I have seen a typical scenario:

(I | He | She | They | We ) will write about the bug later or in the next sprint

Something that will be fixed very late or never.

The authors Jorge and Gina have proof of why we can’t fully rely on electronic repositories a 100%. Which is mainly related to coordination problems.

Do we always record the necessary information to understand the whole story of the bug?

According to their studies the researched bugs databases had the next problems:

  • Some bugs in the records are not bugs in strict sense.
  • Some bugs have duplicate records
  • Some bugs exhibit symptoms that are initially seen as different bugs and recorded separately
  • Some bugs do not always die when they are marked as closed
  • Some bugs basic field in the records are incorrect
  • Some bugs have wrong status.
  • Some life of bugs will never be understood without a face to face or personal investigation.

So in the end it is really interesting to see how when they tried to see the track of the life of the bug they reached dead ends. Or found that histories omitted important details of the bug. I believe our social human factor is the key to why we can’t trust 100% information extracted from electronic repositories.

JUnit and Intelli-J (mac os)

What is Intelli-j? it is basically and IDE for software development, its first release was in the year 2001. It was developed by JetBrains and it’s not based on Eclipse. But i’m pretty sure you aren’t here for this but to to learn how to do a basic setup for J-Unit and Intelli-j community edition. Here is what you’ll need:

  • Mac Os X 10.5 or superior
  • 1GB of RAM as minimum.
  • JDK 1.8

The steps to follow can be found in the next video:

Quick configuration video

If link is broken go here: https://www.youtube.com/watch?v=Z8V7rnvDeB4

Detailed configuration setup video

Link: https://www.youtube.com/watch?v=6k-AA1uR5jY&feature=youtu.be

In general IntelliJ and JUnit 5 configuration is really simple. Mostly because a lot of the Maven integration is done automatically by IntelliJ. So if your goal is to learn how to set up Maven into a Java project, this is not the best method. But if you are looking for simplicity this is a very good choice.

Git repository: https://github.com/kevintroko/JUnitTest

JUnit 5 documentation:https://junit.org/junit5/docs/current/user-guide/

Test && Commit || Revert ?

About two weeks ago I started an internship in a Software company. They like to use this relatively new framework known as Agile. But it isn’t only used where I work, it seems that a lot of companies are trying to migrate to an Agile approach (or some kind of distorted version of it 🙄).

In other words, they like using the SCRUM mindset.

In other words, Ken Beck has influence my work days and probably a lot of many other people.

So after doing a lazy Google research I found out that the Agile roots (extreme programing) were mostly developed by a smart guy named Ken Beck. He did not just worked on this awesome methodology, but also contributed to Test driven developmentSmalltalk, helped popularized the CRC cards along Ward Cunningham, and made the unit testing framework JUnit. It’s incredible all the work this guy has contributed into the Software industry.

Kent Beck (right image) Was one of 17 authors of the Agile manifesto which shaped the constant changing software industry

So what about TCR?

Kent Beck proposes: TEST && Commit||Revert which basically consist in:

If my test pass then I want to commit it!

If I fell that something wrong happened in my code then I can go back to the last time it worked. Therefore, the incentive is to make small changes, all in a stable way. It’s better to have many smaller commits than a big commit with all the different changes.

This doesn’t mean you will have to write more tests. But if you are going to make 3 tests at once maybe it’s better to test one by one so the code of the 3 don’t fully disappear. As Kent Beck says:

How could you make progress if the tests always have to work? Don’t you make mistakes sometimes? What if you write a bunch of code and it just gets wiped out? Won’t you get frustrated?

Kent Beck

And yes, the mistakes will be made, we are humans and the human factor will never assure to have working code 100% of the times. But it is better to instantly wipe out all the bad code. So if you don’t want for big chumps of your work to be sent to the forgiveness then don’t make really big commits between the successful tests.

I guess most of us, university students that hadn’t finish a Testing course, program either by submitting the whole code project until the end, until it’s working as a whole. I’m not counting much the team projects because we commit occasionally, but, it’s a different reason. I think we commit to share code, not to have it safe for testing. And even deeper I guess we don’t do any formal testing.

TDD vs TCR

Test Driven Development: Also created by Kent Beck (is there anything this guy can’t do?), is basically a programming practice where you have to write test first and then write the code that will pass it. Finally do a refactoring.

I don’t have a lot of experience with TDD to be honest. To be even more honest I wasn’t even sure about what it really meant. I guess my testing before this class was running a program, if something goes wrong fix it. And occasionally throw as many weird inputs to see what happens. But I want to change this. Maybe TDD is the solution, maybe not.

TDD workflow

Test Commit Revert: It’s an alternative workflow. TCR is chaotic in a sense that there will be different problems. Maybe TCR will be very weird in Github. To have a lot of tiny commits, for 12 line of code seems incorrect. But there are some solutions as squash commits. If all test passes then commit to master, if anything fails use the the revert button, Life is too short for waterfall planning.

References

You can read the whole Agile manifesto (all along the early 2000’s web pages experience) in here: https://agilemanifesto.org .


First Personal Post 2.0 #TC3045

Image taken from Diyfail.com

Hello my name is Kevin Oswaldo Cabrera Navarro. In the next 3 months I’ll be writing about Software testing, verification and quality. So why does Testing and quality matter?

Quick example of why quality is important sometimes

The emoji movie had a 8% score at rotten tomatoes. Photo credits to Michael Steber

I wonder if there was any quality department inside Sony pictures that didn’t realized about how bad does the idea of this movie actually is. This is the equivalent to the story about how small testing can save tons of money to a company. Probably the correlation is so arbitrary, but it is a good example of why everything should have a quality measurement (it doesn’t matter if it is a movie, a book or a software system)

No bugs in here! 🦗

One of the main goals in this blog is to prevent the usage of the word bug to refer to a fault, error or failure in a program. Maybe it is a word rich in history but in this blog I will try to follow the advices of Paul Ammann and Jeff Offutt writers of the Introduction to Software Testing book to don’t encapsulate all the different meanings into only one word.

But that’s another history for a different post. See you later