A glimpse of Maker Faire 2015

One of the things I love about living in the Bay Area is the sheer passion for technology and the spirit of tinkering here. As a geek, I love that I could just pop into a meetup or brownbag hosted at Hacker Dojo or Y-combinator. The big kahuna of geek fest is of course the annual Maker Faire held at the San Mateo held this weekend. Needless to say I was very excited to go! Here’s a peek into some of the stuff there. No number of pictures can do it justice since it is *so* big. I know this is not strictly “mobile” or “testing” related but I just wanted to share this out to everyone. Hope that’s OK. 

For those who do not know what Maker Faire is, do read this: http://makerfaire.com/makerfairehistory/

Ok let’s go!

At Maker Faire (Bay Area), there’re usually exhibits out in the open and in the various exhibition halls. The open exhibits are usually quirky and fun. Here are some I saw this year:

Signposts at the fair

Signposts at the fair

First of all, we need to know where we are … LOL

Big robot or burning man?

Big robot or burning man?

Steam punk!

Steam punk!

Lots of self made cars

Lots of self made cars

Band's playin'

Band’s playin’

Where's the flux capacitor??

Where’s the flux capacitor??

I wonder what Ctrl-Alt-Delete does.

I wonder what Ctrl-Alt-Delete does.

Heavy Metal

Heavy Metal

More heavy metal

More heavy metal

I wonder what's its MPG ..

I wonder what’s its MPG ..

Moon lander?

Moon lander?

This is an Exo-suit

This is an Exo-suit

See https://www.kickstarter.com/projects/584871825/ajax-exosuit-wearable-powered-exoskeleton 

IMG_20150516_175309

I have no idea what this is ..

I have no idea what this is ..

Dalek?

Dalek?

A fire breathing ... horse??

A fire breathing … horse??

Lego – how the maker spirit starts!

Legos!

Legos!

Lego Caltrain

Lego Caltrain

Battleships!

Battleships!

Bay Area Lego Users Group

Bay Area Lego Users Group

Pley - Lego sets for rent

Pley – Lego sets for rent

Pley – they want to be the Netflix of Lego – www.pley.com

Ok on to all the Geek stuff!

Retro! An Apple II

Retro! An Apple II

An Altair replica

An Altair replica

Apple I replica

Apple I replica

For those who are interested in these replicas – http://www.brielcomputers.com/

Robots, robots everywhere! (and drones)

Robots from Meccano

Robots from Meccano

Bot Bash Party!

Bot Bash Party!

Host your own Bot Bash Party – www.botbashparty.com

IMG_20150516_140812

The Homebrew robotics club of Silicon Valley

The Homebrew robotics club of Silicon Valley

See http://www.hbrobotics.org

IMG_20150516_141057

uarm - desktop arduino powered robot

uarm – desktop arduino powered robot

Where to find them – https://www.kickstarter.com/projects/ufactory/uarm-put-a-miniature-industrial-robot-arm-on-your

Challenge Bot - learn to build your first robot

Challenge Bot – learn to build your first robot

See – http://www.challenge-bot.com

Open PnP - open SMT pick and place machine

Open PnP – open SMT pick and place machine

The OpenPnP machine in action

The OpenPnP machine in action

See http://openpnp.org

Of course these are still dreams

Of course these are still dreams

Hovership - drones!!

Hovership – drones!!

These guys have some cool stuff – http://hovership.com

The Crazyflie nano copter platform

The Crazyflie nano copter platform

See https://www.bitcraze.io/crazyflie/

Not strictly robots but really cool helmets :)

Not strictly robots but really cool helmets 🙂

Micro Drone 3.0

Micro Drone 3.0

See http://www.microdrone.co.uk/

Drone Fight!!

Drone Fight!!

Now for all the IoT stuff 

Hax made a big presence

Hax made a big presence

See http://www.hax.co . Hax is a hardware accelerator.

The CHIP guys are here!

The CHIP guys are here!

These are the guys building the $9 computer – https://www.kickstarter.com/projects/1598272670/chip-the-worlds-first-9-computer

Weaved - smartpower IoT

Weaved – smartpower IoT

See http://weaved.com/iotkit

AgIC - pens to write your circuits

AgIC – pens to write your circuits

See https://www.kickstarter.com/projects/1597902824/agic-print-printing-circuit-boards-with-home-print

Arduino voice control shield

Arduino voice control shield

See https://www.facebook.com/asrshield – Kickstarter in June

The 1Sheeld Booth

The 1Sheeld Booth

See http://1sheeld.com/ – use your Android phone to control your Arduino

DF Robot - IoT and Robotics superstore

DF Robot – IoT and Robotics superstore

The DFRobots store

The DFRobots store

This is a Shanghai based Robotics store that has a lot of stuff – see http://www.dfrobot.com/

InitialState - IoT analytics

InitialState – IoT analytics

With a new market segment comes analytics – https://www.initialstate.com/

Modulo - Lego for IoT

Modulo – Lego for IoT

Kickstarter – https://www.kickstarter.com/projects/modulo/modulo-a-simple-modular-solution-for-building-elec

Electric Imp - FPGA modules you can code in

The Mojo board – learn how to use FPGAs

This was really cool – FPGA modules you can code in – Embedded Micro – https://embeddedmicro.com/

The Parallac - an ARM based supercomputer

The Parallac – an ARM based supercomputer

See http://www.parallac.org/

A breadboard wall

A breadboard wall

Maker Bloks - IoT for kids

Maker Bloks – IoT for kids

See http://makerbloks.com/en

Wearable jewelry

Wearable jewelry

See http://www.lumenelectronicjewelry.com

Flutter Wireless - wireless mesh networks

Flutter Wireless – wireless mesh networks

See http://flutterwireless.com

Samurai Circuits and FactoryForAll.com - manufacturing in Shenzhen China

Samurai Circuits and FactoryForAll.com – manufacturing in Shenzhen China

3D Printers etc

Epilog Laser - laser etching

Epilog Laser – laser etching

IMG_20150516_180544

DiWire - wire bender

DiWire – wire bender

See https://www.kickstarter.com/projects/1638882643/diwire-the-first-desktop-wire-bender

Shaper

Shaper

A waffle 3D printer

A waffle 3D printer

IMG_20150516_175833

Machina Bio - 3D printing for Bio

Machina Bio – 3D printing for Bio

See http://www.machina.bio/

Zeus 3D scanner and printer

Zeus 3D scanner and printer

See http://www.zeus.aiorobotics.com/

Biobot

Biobot

Biobot - 3D printing for Biotech

Biobot – 3D printing for Biotech

Everything luminous

IMG_20150516_152714IMG_20150516_152306IMG_20150516_152305IMG_20150516_152338IMG_20150516_152232IMG_20150516_151205IMG_20150516_151144IMG_20150516_151126

And the cloth makers

IMG_20150516_174549IMG_20150516_174545

Advertisements

Leave a comment

Filed under Uncategorized

Using a Proxy framework to automate API robustness of apps

One of the realities of the new world of CI/CD that we live in is the “bad push” or rather one that was not adequately tested before it was pushed by DevOps via Chef or Docker to production servers. This is because it’s just too easy to make a change on the dev env and promote them over to production. In an ideal world there would be automated tests baked into the CI pipeline to catch these issues but when your app is using 3rd party backends, you are at the mercy of the professionalism of these teams. One way to solve this is simply to build your own middleware to ensure the API responses are all kosher. Another way is to bake in defensive programming into your app’s model layer (as in MVC) to ensure that even if bad responses are received, your app does not barf.

To test this, there are several ways: (a) build a full scale mock server that is able to record and replay backend responses (b) use a proxy to intercept the responses and modify it in several ways:
  1. Add/Remove headers
  2. Modify the content body eg. change values for example of the value is an int, change it to a string etc.
  3. Truncate the content body
There are several advantages of using the proxy server approach: (a) you don’t have to build a mock server from scratch and maintain it (b) you are working with traffic from real production backends.

I chanced upon this tool “mitmproxy” while researching for a tool to do just this. There are some nice things I liked about it:
  1. Easy set up – binaries available for MacOSX and pip install for Linux (Ubuntu)
  2. Inline scripts to intercept end point requests and manipulate responses are in Python so no need for complicated set ups using Maven or ant etc.
  3. 2 modes of operation – interactive and CLI

They have the standard MITM certs to decrypt SSL traffic just like Charles Proxy (which is a great tool btw). See http://mitmproxy.org for details.

Once installed and after both mitmproxy and mitmdump are both in your $PATH, you can start digging in to the tool. Best way would be to use the interactive tool “mitmproxy” first to get the feel for it. There are of course flags to change the port etc (default is 8080). This site (see section 2.6) gives a good intro to how to navigate the tool – http://blog.philippheckel.com/2013/07/01/how-to-use-mitmproxy-to-read-and-modify-https-traffic-of-your-phone/

However the real power of this tool is the fact you are able to run what they call “inline scripts” – essentially pieces of Python code handlers for request, response etc.

Here’s an example code to demonstrate this (you can find this here: https://github.com/foohm71/mitmproxy-stuff – it’s the dumpInfo.py script)
def dumpInfo(flow):
   dict = flow.__dict__
   print "[Flow Info]"
   print "Host:" + dict["Host"]
   print "method:" + dict["method"]
   print "protocol:" + dict["protocol"]
   print "[Request Info]"
   print "request start time:" + dict["requestStartTime"]
   print "request end time:" + dict["requestEndTime"]
   print "request body:" + dict["requestBody"]
   headers = dict["requestHeaders"]
   for k in headers.keys():
      print "request header: " + k + " = " + headers[k][0]
   print "[Response Info]"
   print "response code:",dict["responseCode"]
   print "response start time:" + dict["responseStartTime"]
   print "response end time:" + dict["responseEndTime"]
   print "response body:" + dict["responseBody"]
   headers = dict["responseHeaders"]
   for k in headers.keys():
      print "response header: " + k + " = " + headers[k][0]</code>

def request(context, flow):
   dict = flow.__dict__
   request = flow.request
   dict["Host"] = str(request.host)
   dict["method"] = str(request.method)
   dict["protocolVersion"] = str(request.httpversion)
   dict["protocol"] = str(request.scheme)
   dict["requestStartTime"] = str(request.timestamp_start)
   dict["requestEndTime"] = str(request.timestamp_end)
   dict["requestHeaders"] = request.headers
   dict["requestBody"] = request.get_decoded_content()

def response(context, flow):
   dict = flow.__dict__
   response = flow.response
   dict["responseCode"] = response.code
   dict["responseStartTime"] = str(response.timestamp_start)
   dict["responseEndTime"] = str(response.timestamp_end)
   dict["responseHeaders"] = response.headers
   dict["responseBody"] = response.get_decoded_content()

   dumpInfo(flow)
<div>

All this does it extract out information about the request/response and puts it in a dict object that is passed around. Once done, it just prints out the information. To run this, use the CLI version of the tool in this way: mitmdump -s <script>

As there is a framework for this, we could extend this code to perform the following: based on different end points (or hosts), protocols, body, we could perform different types of response manipulation.

One example of response manipulation could be to just truncate a JSON response like this:
deftruncateJSONString(jsonstr, length):
   return jsonstr[:int(length)]

Another could be to recursively parse the JSON response for a key and replace its value:
def findReplaceValue(jsonobj, key, value):
   if type(jsonobj) == type({}):
   for k in jsonobj:
      if k == key:
         jsonobj[k] = value
      findReplace(jsonobj[k], key, value)
Sometimes your request is in the form of a form POST, in that case, you may need to extract a form field and perform the response manipulation based on that or a combination of fields:
form = request.get_form_urlencoded()
username = form[“username"]
dict[“Username”] = username

Leave a comment

Filed under Uncategorized

What is Quality?

As someone who has worked in the area of quality/test engineering for some time, this question has popped up time and again. I have also been involved in several discussions among peers about this question but I have never quite gotten a satisfactory answer, at least not for myself.

Some time back, while reading the book “How Google Tests Software”, I came across the line

Quality != Testing

This really made me balk and ask myself “so what then is Quality, in particular Software Quality?”.

This must come as a surprise to the uninitiated but for those of us in the so called Quality and Test specialization in software engineering, we spend most our time and energy honing the art of testing. Functional testing, performance testing, unit testing etc, how do we test this feature, how do we test that component, how do we “break” the software? Those are the questions and challenges that plague our profession.

So what then is Quality?

I pondered this for a quite a while and then one day it hit me: Quality is and has always been synonymous with the luxury industry.

Take for an example how a Hermes Birkin bag compares to a Coach (now if you’re male, single and straight, you had better learn to distinguish the two fast). One costs a tens to hundreds of thousand dollars and the other a few hundred.

Why is that? A bag is a bag is a bag right? Nope. Each Birkin bag is hand-sewn, buffed, painted, and polished by expert artisans. Note: expert artisans. Artisans who are passionate about their craft.

At the end of the day quality comes down to craftsmanship. We pay for the craftsmanship, not the object.

Software quality, it follows, comes down to software craftsmanship –

1. how systems are designed
2. how systems are built
3. how systems are tested
4. how systems are deployed

Craftsmanship is about pride in the product one is building and it is about knowing and practicing the various aspects of this process.

In “Clean code, A handbook of Agile software craftsmanship”, Robert Martin describes software craftsmanship as both knowledge of the principles, patterns, practices and heuristics that a craftsman knows; augmented with the hard work of applying that knowledge in the daily grind of churning out production ready code. It is hard work and it takes discipline.

Quality hence is everyone’s responsibility. From the design of the UI so that users find it aesthetically pleasing to use, architecting for performance, modularity and testability, deploying in a seamless fashion that minimizes the impact to users, writing code that is efficient yet maintainable; and testing – putting the system through its paces and figuring out what could possibly cause the software to break, or what functionality was missed.

So if quality is everyone’s responsibility, what then is the role of the quality or test engineer?

I would say that it is to encourage software craftsmanship.

This goes beyond testing, although that is the bread and butter of our profession.

Why bother? Wouldn’t it be much easier to just test and report bugs? Yes, but then the true value of finding those bugs is lost. The true value is in asking why those bugs came about in the first place and trying to put in place measures so that it doesn’t surface again. In short – encouraging software craftsmanship.

However, in order to know what good code looks like, you need to have either built code, seen bad code, seen really good code – and mostly all of the above.

Coming back to the Birkin bag analogy: an expert is able to tell a real Birkin bag from a fake. It is down to the fittings, how the leather is prepared, how well the stitching is done. I know intimately about this because I have an uncle who is certified to repair Louis Vuitton products.

In the same way, you can tell if software is designed and built well. But like art, you would have had to have seen/worked with well designed code/systems to know how they look like.

Only when you have seen quality can you build quality.

2 Comments

Filed under Uncategorized

Shameless plug – Twitter account

Some time back, I created a Twitter account to tweet all mobile and mobile testing news. You can access this twitter channel via @mobilepotpurri

1 Comment

Filed under Uncategorized

Automating Android Native Apps Testing using MonkeyRunner

MonkeyRunner is a tool that comes with the Android SDK. It is basically a tool using python scripts to run automation for Android apps.

The Android SDK site has a simple example of a monkeyrunner script and how to run it. See “A Simple monkeyrunner program” and “Running monkeyrunner” – both can be found here. For a start, don’t run with the plug-in option.

One thing to note about monkeyrunner is that unlike UI Automation or any of the other automation tools, you don’t search for a UI element and click (or tap) on it. Instead, you use the keypad keys to navigate. I found using the up, down, left, right and center keys most useful. Also there doesn’t seem to be a way to look for  UI elements and extract the labels or even accessibility keys.

There are 3 main components for monkeyrunner: MonkeyRunner, MonkeyDevice and MonkeyImage classes.

The MonkeyRunner class contains static utility methods to do a run – the most important being the WaitForConnection() method which returns a MonkeyDevice class for actual testing.

The MonkeyDevice class is the most important as its methods control the device eg. install a package, perform button press, drag, start Activities.

The MonkeyImage is used for capturing screenshots.

Some Issues to take note of

There is also a typo in the script found in the SDK documentation:

# sets a variable with the package's internal name
package = 'com.example.android.myapplication'


# sets a variable with the name of an Activity in the package
activity = 'com.example.android.myapplication.MainActivity'


# sets the name of the component to start
runComponent = package + '/' + activity

Will mean that runComponent='com.example.android.myapplication/com.example.android.myapplication.MainActivity'
instead of com.example.android.myapplication/.MainActivity which is correct.

Also for some reason, I could not get the script to run with
device.press('KEYCODE_MENU','DOWN_AND_UP')

as it seemed that the ‘press’ method required 3 params instead of 2. I just added a dummy string param at the end eg. ‘xx’.

Note that the script is written in Python – here is a decent for the Python language I found useful.

Leave a comment

Filed under Android, Native App, QA, Testing

Getting screencaptures for iOS Devices

For iOS devices, there’s a neat way to capture the screen by just holding down the “home” button and pressing the top button.  See this blog article.

This works for iPhone, iPod Touch, iPad.

Once the screenshot is saved on the device, you can then email it to report the issue.

Here’s a video on the steps as well:

Leave a comment

Filed under iOS, QA, Testing, Useful tips

Getting screen captures for Android Devices

One of the very useful tools in reporting issues is the screencapture.

For Android, this usually means hooking up the device to the Android SDK. If you’ve not installed the SDK, you can check out this article.

ITBlogs has a good step-by-step article for this here.

Here’s a video explaining how to do this as well:

Leave a comment

Filed under Android, QA, Testing