Monday, 3 July 2017

Jumping Scrum

Today during my Scrum Meeting I realized that some of team member’s have really a lengthy status update. 
Still must wait long before jamming in my status standing and listening to everyone out there. 
This is quite good, functional terminology or know the complexity of the work a team member is been handling day in and day out.
 However, I always feel to be more precise in saying what I did yesterday and what I am going to do today five -six lines enough to explain where the boat is heading right now. 

Sometimes I feel what if we add fitness to our scrum making it a Jumping Scrum how gonna be the salsa.

The intent is to Jog on your current position, speak your status update while you jog 😊. I understand you can run miles this way speaking.


The other advantage I see, members become more active if your scrum meeting is the first thing that you  do when you reach office every morning. 😊…. Drop your coffee mate you need to throttle while you attend your next jumping scrum… Oh yam the belly fat oh yea the fitness freak.

Wednesday, 19 April 2017

Selenium Web Driver Singleton Class


Today I applied singleton design pattern for Selenium chrome driver. I wanted to share the same instance of the driver across different steps. The pattern appeared most promising to me, Luckily the pattern Singleton is the one that fill my needs

 Under The hood this time I wrote some C# code to apply the idea.



The variable Instance holds the single instance of the class.

The constructor is declared private.



This provide me the global access and a single instant of the web driver.



Love it as I would always be using one instant of it.



using System;

namespace carsales

{

   public class Driver

    {

        private static IWebDriver Instance;

        private Driver()

        {

        }

        public static IWebDriver Int()

        {

            if (Instance == null)

                Instance = new ChromeDriver();

            return Instance;

        }



        public static void Navigate(string url)

        {



            Instance.Navigate().GoToUrl(url);

        }



        public static void Close()

        {



            Instance.Close();

        }

    }

}

Tuesday, 12 July 2016

Dual Boot Centos 7 and Windows 8.1

Today I set up my machine for dual boot up with CentOs7 and Windows 8.1 Under the hood. However after install  i realised that by default CentOs7 did not provided a dual boot option, leaving windows totally invisible .

I started searching and trying to resolve the issue spent about an hour  to jot down the below learning’s

To make windows boot loader appear follow the below steps.
  • Start Centos  and Launch Terminal ,perform the following command

                                    sudo grub2-mkconfig > /dev/null
  
         I was sure that the windows partitions are not anyhow visible .

  • I disabled packagekit as it was occupying the yum using this command , this disable it permanently.

                                  system disable packagekitd
  • Once the yum is available for action I performed the following commands

                                   yum install epel-release
                                   yum install ntfs-3g
  • Now rerun grub2 make

                                  sudo grub2-mkconfig > /dev/null  : 

it should show the windows partition.
  • Once the windows partition is available it’s good to save the existing grub.config


                               sudo cp /boot/grub2/grub.cfg  /boot/grub2/grub.cfg.backupoldfile
  • Now a new configuration file can be created and saved 

                               sudo grub2-mkconfig –o /boot/grub2/grub.cfg


Reboot your machine and now dual boot should be available with windows. 

Monday, 30 May 2016

Yes I am a Flaky test

Every thing went well since last 10 years , till I recognized members of my team are pulling me out today from every direction giving too much attention, spending their valuable time in analysis, debug without actually understanding why I have failed.

Oh my Expert Developer, its not healthy to consumerism 1000 mg of caffeine, to tune entire Friday night just to conclude that I pass every time on development machine but some how failed when you pumped in $1000 hot fix, 

The quality head you really find critical issues but this time your issue will be marked as Not a issue 

and My dearest manager you invested too much capital to develop a solid portfolio of build evaluation tools nevertheless evaluated the quality of work the developer did based on the recent check-in. 

Oh My God this shall pass. Everyone is working really hard these days.


However being flaky test I kept watching Every time you pre-configure environment, rebuild or re-execute me.

Just to bring down your excessive stress  Its not that there is a product issue, its not that I fail regularly, its that I  have been implement with lot of dependency, I sometime lack resources during execution, some time you verdict before the actual operation is completed, sometime concurrency, some times test configurations and sometime I am run without the pre-requisites.

The grass shall have been greener on this side, if some time was spent carving me, minimizing dependency that downgrades my expertise to find a regression bug.


A research list some of the factors as Async Wait, concurrency, test order dependency, resource leak,Network ,Time,IO,Randomness,Floating point Operations, Unordered collections and something that you know which world does not know .


I get dishearten as I am on top list to be quantized, that is you may not need me to evaluate your current build  or I am getting to much emotional to be fired actually, as I am failing without providing any value addition to both developers and testers, in addition I respect the time you spend on me every-time I get into notice release after release developer after developer tester after tester that come and go time to time in this competitive world.

Being declared flaky I request you to run me couple of time to see whether I behave same, I may unlock the bug for whom I was really incepted. The project that led me to existence was a big hit and many folks working on it  dint actually knew what's going else where in the market.


If you think this is less worthy why don’t do some analysis and determine my performance on some other configuration or my behavioural  patterns from couple of days.


Oh Yes I am a flaky test but I believe I am worth execution....

Friday, 27 May 2016

Code Coverage Using Google Test for unmanaged code using Visual Studio

Folks I am back with a shout out. Today we are going to walk on creating a static library in Visual c++ and will use Google test to write unit test and perform code coverage.
In this small article I will be using a set of utilities
Visual studio 2013, Google Test Runner that integrate in Visual studio for easy discovery of gtest and the finally the Google test framework. I am writing this to get a quick revision if some day I walk back again to do it again.


The very first step was to download the tool shown above

I downloaded the gtest framework and compiled the library using the following setting



Once the library is ready I created a dummy static library to get some hands on testing and named it as Win32Project1 which simply had two functions sum and sub.



To start writing some Google test code I created a another C++ console based application and configured it with the settings to get code coverage by setting linker properties of the test project as


And advanced->profile as

Do you know that the above two settings will help me to get coverage of the api I am going to test in a while.
One these are set I created a dummy Gtest which is very basic and ran it using the test runner. Notice that I have to set of test written one from Microsoft unit testing other from google test setting applied before writing test was.

 
As the picture show sum is 100% covered however the sub is not covered as I have no test written for it in Google Tests.




Wednesday, 1 July 2015

PTE- Academic Speaking Tips:

Machine learning:  Given a task T with a performance measure P the machine learning experience E is said to be derived in such a way that the performance on Task T improves with experience E.

More the data, more the analysis ,more is the evaluation ,more is the probability of errors. Serious readers logically can understand the analysis on the input data and the results. 

Here are some tips to go ahead 

 Check:
Before the the test start. Check your headphones read some sentences from the section which shows about the mic check steps. Try to read a sentence and two and adjust your microphone properly don’t practice the old 123 mic check. Try to read the way you will read in sections to come. Hear your voice and check is it what you sound like and audible with no sound of your breath,if not adjust your MIC, even then if the issue exists raise your hand and the ask for a replace. Time is not clocked for this activity so make sure things are the way you want before you begin.
1.       Read aloud.
      General Tip
In time to practice a sentence perform a fake reading don’t concentrate on surrounding concentrate on your goal. Cool your self down in this time, to clear your voice hold your tongue between your teeth and then read ,when you will begin the actual reading your voice would be very clear try this before you believe it.
Action time :
Divide the sentence into meaning full chunks and read in speed(dont compromise on the pronunciation with this speed) make sure you spend a little more time on the important words usually nouns verbs in a sentence. Maintain speed or a rhythm, do not rush but be confident much like:a news reader.

 A note: Don’t doubt your self, computer would only analyse what you will do, so do it the right way.

2.       Repeat sentence
The short sentences are easy to remember but some time some complex sentences come. When you speak, speak in one go don’t pause between words. Focuses on finishing the sentence in one go no breaks anywhere.

3.       Describe image
The more you speak the more is the chance of error. Be specific and without hesitations speak the following about the image. 
·         Introduce the image
·         Give trends for highest and lowest
·         Conclude what is over all idea
20-25 seconds will be consumed in all this, go ahead the haunt is over.

When you construct sentences about graphs use the graph vocabulary like dramatic fall, significant decrease .  For table what the table contains and the highest and lowest and then overall conclusion from the table . 

Example image.
This image shows how a song can be played from the multilingualism website. The first step is to search the song. The second step is to download the song followed by saving the downloaded song in your hard drive . Finally user can play the saved song . Overall this image lists the steps how a user can download and play a song.

4.        Retell lecture
Make notes during the lecture. Speak in general what the speaker was telling, get some data from the notes you wrote add if example are provide.  Try to conclude if you understand. Don’t fumble and note “the answers will be analysed base on your response so be correct in what you speak?. Here I mean the correct English with no hesitations. The way if some one asks what is your name and then comes your response. J… Machine learning.

Though this section appears complicated but the key is what you write in your notes and how well you respond back. Create correct and small sentences. 

Notes:

Modern Cars

Cost of cars 
      Decreased over the time
      Fuel efficient
    
Future :Advanced technology 
     Better safety 
     pollution free
    More intelligent 

Speech:    
The lecture was about the modern cars . As per the speaker cars nowdays have become more fuel effiecent .Moreover there costs have decreased . However the speak expects that in future they would be pollution free with better safety as they will become more intelligent. Overall this lecture was about the future of modern cars.



5.       Answer short questions: once the recording start speaks the answer usually they are single words or a group of words.

Monday, 12 May 2014

Model Based Testing

From couple of days i am researching on Model Based Testing. Really wanted to have good grasp on fundamentals of testing my code using model based testing.

Finally i landed on Microsoft Spec Explorer and N Model. Their are many commercial tools available in this subject , but as a Novice i opted to use  above for my test purpose.

The integration of Spec Explorer with Visual studio really made my analysis easy , while using N Model i have to code more to generate tests, generate models and finally run the tests against implementation.

Abstraction plays a key role in designing models.

I created few test applications using c#, modeled the use case and generated offline tests using spec explorer.

At times To provide a good code coverage it becomes difficult , to unit tests but using Model Based testing i was able to get a good code coverage very fast , identified Dead code and finally wrote some better code.







Wednesday, 17 July 2013

Know about virtual functions in c++

// Base class is going to add a virtual pointer
// Every class having virtual functions have a vtable
// vtable contains the list of functions pointers which object of that class can call
// vptr points to the function defination of the class it points to.




* Class Test show the concept of virtual tables
// Derived class having overridden functions
// VPTR And the concept of virtual table which contains static array created at compile time listing all function pointer to
// virtual functions that can be called by the object of the class .

 FUNCTION IS MAPPED TO THE CORRESPONDING FUNCTION OF THE CLASS

class test
{
int val;
public:
test()
{
cout<<"Default Constructor of base class"<<endl;
}
virtual void fun1()
{
cout<<"Base class function fun1"<<endl;
}
test(int x)
{
val=x;
}
virtual void fun2()
{
cout<<"Base class function fun2"<<endl;
}
};class Housetest:public test
{
int houseval;
public:
Housetest()
{
cout<<"I AM DEFAUTL CONSTRUCNTOR FOR HOUSE TEST"<<endl;
cout<<"House Test dont have fun1"<<endl;
}
Housetest(int x):test(x)
{
houseval=x;
cout<<"Value of x"<<houseval;
}
void fun1()
{
cout<<" I am fun1 from house test"<<endl;
}
};
class classtest:public test
{
int classval;

public:
classtest()
{
cout<<"Class test dont have fun1"<<endl;
}
void fun2()
{
cout<<" I AM FUN2 FROM CLASS TEST"<<endl;
}
};

int _tmain(int argc, _TCHAR* argv[])
{
test *x= new classtest;

x->fun1();
x->fun2();
cout<<"----------------------------------------------------\n"<<endl;
cout<<"I am creating a new object of House test now"<<endl;
cout<<"----------------------------------------------------\n"<<endl;
x=new Housetest;
x->fun1();
x->fun2();
return 0;
}

Operator overloading in c++ with example

Operator overloading

This gives us flexibility to use operators with class objects.

Operator overloading is done by two ways

1. Member function : Take atmost one argument
2. Friend function: Take at most two arguments

This limits the overloading to apply for uninary and binary operators.

// The Test Class show the opertor overloading
// Overloads + operator using Friend function
// Overloads - operator using Member function
class test
{
public:
int a;
int b;
friend test operator +(test &, test &);
test operator -(test &);
test()
{
}
test(int x, int y)
{
a=x;
b=y;
}};test test::operator -(test &t1)
{
test temp;
temp.a= t1.a-a;
temp.b= t1.b-b;
return temp; }test operator +(test &t1, test &t2)
{
test temp;
temp.a=t1.a+t2.a;
temp.b=t2.b+t2.b;
return temp;
}
int _tmain(int argc, _TCHAR* argv[])
{
test t1(3000,2000);
test t2(1000,1000);
test t3;t3= t1-t2;
cout<<t3.a<<t3.b<<endl;
t3=t1+t2;
cout<<t3.a<<t3.b<<endl;
return 0;
}



// Class Balance Perfom operator Overloading
/// Overloads + * using member function
// Overloads / - using friend function
class balance
{
public:
int start;
int end;
public:
friend balance operator /(balance &, balance &);
balance()
{
start=end=0;
}
balance(int x,int y)
{
start=x;
end=y;
}
balance operator +(balance&);
friend balance operator -(balance &, balance &);
balance operator *(balance &);
};
balance balance::operator*(balance &b1)
{
balance temp;
temp.start= b1.start*start;
temp.end=b1.end*end;
return temp;
 }balance operator /(balance &b1,balance &b2)
{
balance temp;
temp.start= b1.start / b2.start;
temp.end =b1.end /b2.end;
return temp;
}
 
 
 
 
balance balance:: operator +(balance &b1)
{
balance temp;
temp.start=b1.start+start;
temp.end=b1.end+end;
return temp;
}
balance operator -(balance &t1, balance &t2)
{
balance temp;
temp.start=t1.start -t2.start;
temp.end=t1.end- t2.end;
return temp; }int _tmain(int argc, _TCHAR* argv[])
{
 balance b1(100,0);
balance b2(100,20);
balance b3;
cout<<"------------START---------------------\n";
cout<<"b3.start"<<b3.start<<endl;
cout<<"b3.end"<<b3.end<<endl;
cout<<"------------add---------------------\n";
cout<<"b1.start"<<b1.start<<endl;
cout<<"b1.end"<<b1.end<<endl;
cout<<"b2.start"<<b2.start<<endl;
cout<<"b2.end"<<b2.end<<endl;
b3=b1+b2;
cout<<"b3.start"<<b3.start<<endl;
cout<<"b3.end"<<b3.end<<endl;
cout<<"------------sub---------------------\n";
cout<<"b1.start"<<b1.start<<endl;
cout<<"b1.end"<<b1.end<<endl;
cout<<"b2.start"<<b2.start<<endl;
cout<<"b2.end"<<b2.end<<endl;
b3=b1-b2;
cout<<"b3.start"<<b3.start<<endl;
cout<<"b3.end"<<b3.end<<endl;

cout<<"------------mul---------------------\n";
cout<<"b1.start"<<b1.start<<endl;
cout<<"b1.end"<<b1.end<<endl;
cout<<"b2.start"<<b2.start<<endl;
cout<<"b2.end"<<b2.end<<endl;
b3=b1*b2;
cout<<"b3.start"<<b3.start<<endl;
cout<<"b3.end"<<b3.end<<endl;
cout<<"------------div---------------------\n";
cout<<"b1.start"<<b1.start<<endl;
cout<<"b1.end"<<b1.end<<endl;
cout<<"b2.start"<<b2.start<<endl;
cout<<"b2.end"<<b2.end<<endl;
b3=b1/b2;
cout<<"b3.start"<<b3.start<<endl;
cout<<"b3.end"<<b3.end<<endl;
return 0;
}

Casting in c++

The below example demostrates the types of casting available with c++.

C++ is strongly types language. 

The example below demostrates the diffrent.

Please read the comments to know some theory about the diffrent types of castings.

class base
{
public:
int a;base()
{
cout<<
"Base class object"<<endl;}

void fun(){
cout<<
"Function from base class"<<endl;}
};
class der:public base{
public:der()
{
cout<<
"Der class object"<<endl;}

int b;
void fder(){
cout<<
"Function from derieved"<<endl;}
};
class unrelated{
public:unrelated()
{
cout<<
"Unrelated class object"<<endl;}

void funrelelated(){
cout<<
"Function is unrelated"<<endl;}
};
 
int _tmain(int argc, _TCHAR* argv[]){

// created pointer and objects of each of the class we defined base *bp;
base bo;
der *dp;
der doo;
unrelated *up;
unrelated uo;
// Lets talk about Dynamic cast before we start implementing// 1. Applies to pointer and objects of related classe// 2. Allows downcasting fails in downcasting// 3 Always check that the object are converted or notbp= dynamic_cast<base * >(&doo);//dp= dynamic_cast<der *>(&bo);// This statement will fail or not compile
// Static cast can perform conversion between pointers to related clasees.
// No overhead of type safety check
der *stcst=static_cast<der *>(bp);// Reineterpretcast covnverts any pointer type to any other pointer typer even of unrelated classesbase *bp= new base;unrelated *ur=
reinterpret_cast<unrelated *> (bp);// Constant removes the constantness of object


return
0;}

Apache Beam Learning In Java Tutorials

 Wow  https://youtu.be/9kGETU63rkc