Tuesday, October 16, 2018

Journey into SET: Part 1

So, I'm getting back into the game of software testing and especially with the new test automation tools and techniques. I'm going to log my journey of catching back up in this field after being in software development (away from testing to purely coding without testing - and I know this is bad). So, let's just add that I'm restoring the best practices of a software engineer.

Nowadays, it seems the new title for software testers is either Software Development/Design Engineer in Test (SDET) or Software Engineer in Test (SET) or similar. The emphasis is on the evolving skills of a tester having the capabilities to develop (or code) meanwhile advancing their techniques of applying best practices in test automation. This makes sense when we consider how the multitude of frameworks for development web application and software tools has also evolved.

Here are some articles to read.

Evolution of the Software Testing role:


One can also gain an understanding of what a test engineer (or SDET or SET) does today by looking up the job qualifications on major tech company career websites including Google (specifically "Test Engineer"), Amazon (spec. "Software Development Engineer in Test"), Microsoft (spec. "Software Design Engineer in Test").

A Quick Recap from Microsoft's Personal Experience
Here's a nice recap from Microsoft on the transition of eliminating the Software Test Engineer (STEs) and creating a "combined engineering" team.


Software Test Design
Similarly to developing any software, developing scripts to test software also should go through the design phase in order to create test structure. This helps with organizing tests to correspond to the software design, finding bugs early in the design process of software development, creating a testing framework for easier ramp-up of new Test Engineers and for easier review of the software development team, and more.

Software Test Design - Problems
First problem I'm interested in is what to name the appendages of the class files especially for the automated test scripts via the browser.
Unit Tests use the appendage "Test" like "HelloWorldTest".
Integration Tests use the appendage "IT" like "HelloWorldIT".

I've seen throughout the Selenium docs the term "AUT" (or application under test) and wonder if I should use this as the appendage for my test scripts via browser like "HelloWorldAUT". But is this sufficient?

Software Test Design - Research
https://dzone.com/articles/design-patterns-in-automation-testing

What is SOLID (Principles)?

  • Single responsibility
  • Open-Closed priniciple: open for extension and closed for modification
  • Liskov substitution
  • Interface segregation
  • Dependency injection

https://msdn.microsoft.com/en-us/magazine/dn683797.aspx (dated: May 2014)
*There are a number of terms explained in this article that I really like. For instance, the author says "when I say principle, I'm referring to a feature of the computer code that helps maintain the value of that code."


Software Testing Conferences
Here are some conferences to be aware of with respect to software test automation and the future of testing software.



Software Test Tools
There are a lot of tools from the many articles online that I've read. Not to overwhelm one with reading through all the articles and also knowing that the software tool depends on the software developed, here's a short list of tools that I'm learning and applying.

Leading the list is Selenium as the best, open source tool for testing web applications.


I should really keep track of my progress here. This is getting way too long. So I need to split this step into smaller steps and start publishing.

Monday, October 15, 2018

Loading Properties file for Test Automation

I am trying to load a simple.properties file into my test suite as soon as I run my test automation.

I tried following tutorial on Apache Commons, but I am missing the configuration2 package. I don't have time to download this and install since I'm working on a secure network.
https://commons.apache.org/proper/commons-configuration/userguide/howto_properties.html

To be exact, I need the configuration2 package for the Parameters class.
https://commons.apache.org/proper/commons-configuration/apidocs/org/apache/commons/configuration2/builder/fluent/Parameters.html

Okay, now what?

Well, let's first use basic Java to load a Properties file and test it.

I can't remember the website where I got this code from, but it is similar to the basic Java tutorial with the exception of using a BufferedReader instead of the InputStreamReader or the like. I added this into my init() method.

private Properties properties;

@Before
public void init() {
    Log.Info("Starting my test automation...");

    BufferedReader reader;
    try {
        reader = new BufferedReader( new FileReader( "src/test/resources/simple.properties"));
        properties = new Properties();
        try {
            properties.load(reader);
            reader.close();
        } catch (IOException ioEx) {
            ioEx.printStackTrace();
        }
    } catch (FileNotFoundException fileEx) {
        fileEx.printStackTrace();
        throw new RuntimeException("simple.properties file not found!");
    }
}

// Note, inside of my simple.properties file is: 
// testword = hello
@Test
public void testPropertiesFilesLoaded() {
    Assert.assertEquals(properties.get("testword"), "hello");
}

I ran this from the command line using Maven.
$ mvn -Dtest=SimpleTestAUT test -pl :app-ui

And the test passed! Yay!

Now, I need to know how to really use this properties file across my test suite. I have a Sample1AUT.java and Sample2AUT.java. In Sample1AUT.java, I have the following.

@BeforeClass
public static void setup() {
    MyProperties.loadProperties("myPropertiesFileName");
}

@Test
public void testPropertiesLoaded() {
    Assert.assertEquals("user", MyProperties.getProperty("biz.username"));
}

This is what my MyProperties class looks like.

public class MyProperties {

  static Properties properties;

  public static void loadProperties(String fileName) {

    BufferedReader reader;

    try {
        reader = new BufferedReader( new FileReader( "src/test/resources/"+fileName+".properties"));
        properties = new Properties();
        try {
            properties.load(reader);
            reader.close();
        } catch (IOException ioEx) {
            ioEx.printStackTrace();
        }
    } catch (FileNotFoundException fileEx) {
        fileEx.printStackTrace();
        throw new RuntimeException(fileName+".properties file not found!");
    }
  }

  public static String getProperty(String key) {
    return (String) properties.get(key);
  }
}

It worked, yay!

What I need to try next is loading Properties file via Krausening in case my "test/resources" folder is not deployed with the WAR including the Test Suite.

References


Monday, September 10, 2018

Not actually a minifesto

Devs,

Here's another interesting article that I just read.
http://minifesto.org/

Not sure I would agree with everything especially with calling this a "mini"festo, but I get this author's point. I also would use better terms instead of "killing the baby". Anyhow, just something to read and think about. In essence, fail fast, work fast, better is good (thanks President Obama), and keep your eyes on the win.

Discovering Datasets with Google

Devs,

If you haven't already been keeping abreast of all the data science hype, then I would suggest that you get with it. Although I haven't been able to keep up with the "hype" (and I call it "hype" because everything with computers has been on processing 'data'), this doesn't mean you have to wait for me. I'll catch up eventually. I have just have other priorities right now in this season of my life (aka two toddlers).

Here's an article I enjoyed reading. Cheers!

https://www.blog.google/products/search/making-it-easier-discover-datasets/




Tuesday, September 4, 2018

True "Agile Development"

Devs,

I'm not going to say much since some developers have the tendency to talk in circles on certain topics like "what is Agile". Instead, I am posting an article that I just read and totally agree with (who is actually one of the founders of the Agile Manifesto). I actually took part in this "experimental" phase when it came out with my first corporate job in Minnesota. From there, I've been on teams in Boston and in DC. There has only been one other team which was a Boston, small business that worked close to the principles of Agile. This is perhaps because the CTO was co-founder of the business.

Therefore, I'm realizing that for an organization to truly be Agile, one of the co-founders must be extremely technical if not a co-founder/CTO.

https://martinfowler.com/articles/agile-aus-2018.html
  1. Get rid of the Agile Industrial Complex and the idea of imposing stuff on teams. Let teams work out the way they should work themselves.
  2. Raise the importance of technical excellence, and never forget that when writing software, the technology side is really vital, and
  3. organize around products.
One area I wish Martin would have highlighted is the importance of "smart users". That is, users are who are aware of how to develop their product to make life easier. I don't mean easier like "make a better car" but visionary like "make a self-driving car". That kind of vision (which requires an imagination - thanks GE) is the kind of easier I'm referring to. Somehow, I thought with more people using all of these gadgets that people would become more creative. I'm still waiting to witness, hahaha.

Enjoy the ride!

Wednesday, May 3, 2017

Frameworks over Languages?

I recently read this article:
http://www.kdnuggets.com/2017/05/frameworks-offer-data-scientists-programming-languages-lack.html

What a mind opener and so true (to a degree, but a high degree)! Why bother with languages that a person has to learn and do all kinds of stuff, when one can leverage a framework and - viola! - create something rapidly? Ruby-on-Rails is a great example. Perhaps it's why it's one of the most useful RAD frameworks. Of course, there are cases when a person will not want to use a framework (or find one that more-so matches the product development's purpose). For example, if you need to customize a lot instead of following conventions, then Rails is not for you. Spring might be a better match, but that involves switching languages. I haven't researched and played with all the different Ruby frameworks, but perhaps there is one that is more flexible and customizable?

Either way, know the frameworks and don't dig too deep into the languages UNLESS you must use the specific language to accomplish your goal.

Good luck,
G2

Thursday, April 13, 2017

Electron - Quick Introduction (destop app in JS)

Hey Dev Fam,

I wanted to know what "Electron" was and went through these tutorials.

Red Stapler's quick tutorials on Electron

Introduction & WebApp -> DesktopApp Quick Conversion

https://www.youtube.com/watch?v=1Qf2Yjz-zsk

Hello World

https://www.youtube.com/watch?v=sJFuMKPfpfs

Packaging Application

https://www.youtube.com/watch?v=rP7j_hDL40Y

Another Overview on Electron

https://www.youtube.com/watch?v=mr9Mtm_TRpw

GitHub's Electron Overview 2016

https://www.youtube.com/watch?v=FNHBfN8c32U

GitHub's selling point on using Electron is:

If you can build a website, you can build a desktop app. Electron is a framework for creating native Desktop applications with web technologies like JavaScript, HTML, and CSS.


Happy Coding,
G2