QE: Cost of fixing bug

Screen Shot 2018-06-05 at 3.19.31 PM.png

Advertisements

Python: Check if all elements in a list are equal

# Pythonic ways of checking if all
# items in a list are equal:

>>> lst = ['a', 'a', 'a']

>>> len(set(lst)) == 1
True

>>> all(x == lst[0] for x in lst)
True

>>> lst.count(lst[0]) == len(lst)
True

# I ordered those from "most Pythonic" to "least Pythonic" 
# and  "least efficient" to "most efficient". 
# The len(set()) solution is idiomatic,  but constructing 
# a set is less efficient memory and speed-wise.

Git: Combining the commits

To squash the last 3 commits into one:

git reset --soft HEAD~3
git commit -m "New message for the combined commit"

Pushing the squashed commit

If the commits have been pushed to the remote:

git push origin +name-of-branch

The plus sign forces the remote branch to accept your rewritten history, otherwise you will end up with divergent branches

If the commits have NOT yet been pushed to the remote:

git push origin name-of-branch

Certificate : Loopback course completion

Loopback is a very power api development framework on node.js. It allows you to build your entire api system with live api documentation ( swagger ) in a very fast and secure way. I finished this course and exposed few apis for some of my clients project.

Investing time and efforts is worth in this. Go for it.

LoopBack-K2EFKET5

 

This certificate above verifies that Aseem Jain successfully completed the course Node.js : Rest Apis Development Using Loopback on April 27, 2018 as taught by Haider Malik on Udemy. The certificate indicates the entire course was completed as validated by the student.

 

 

What is a Data Driven Testing?

Essentially, data driven testing is when we test the same behavior multiple times with different parameters and assertions. A classic example of this would be testing a mathematical operation such as squaring a number. Depending on the various permutations of operands, the result will be different. In Java, the term we may be more familiar with is parameterized testing.

Groovy: Multi threaded producer consumer program

import java.util.concurrent.BlockingQueue
import java.util.concurrent.LinkedBlockingQueue

BlockingQueue queue = new LinkedBlockingQueue();

Thread.start('Producer') {
    10.times {
        println(Thread.currentThread().name + " adding $it")
        queue << it
        sleep(100)
    }
}

Thread.start('Consumer') {
    for(i in 0..9){
        sleep(200)
        print(Thread.currentThread().name)
        println("consuming ${queue.take()}")
    }
}