SWTC Manchester - Technical Testing

On 20th August 2018 we reached the Technical Testing session at Software Testing Clinic Manchester.

This session is slightly different from the previous ones in that it takes the form of a ‘circus’ , where different technical testing skills are demonstrated, each at a different station, and the attendees can move around the stations to learn about each skill.

We were really lucky on the night to have some fantastic volunteers giving 20 minute demonstrations :

The students split off into groups of 2 and moved around the stations after each 20 minute demo. In total, we had time for 4 rounds of demos, so a huge thanks to the volunteers for running through them multiple times. They were encouraged to ask questions, and all the attendees seemed really engaged with the activities.

We closed the session with a short wrap up talking about how Technical Testing covers a broad range of subjects, not just test automation and writing code, and that we’d seen just how many activities could fall under the term ‘Technical Testing’ from the demonstrations.

A massive thanks goes to all of the volunteers who agreed to come and do a demo, we couldn’t have put the session on without you! If you’d like to add any useful links or information about what you covered in your session in the comments feel free to do so.

Thanks as well to our attendees, we hope you learned something, and we’ll see you for the next SWTC session in September !!

Useful Links:


Hey everyone, so I covered a basic introduction to Android Debugger Bridge (ADB), props to Stephen Janaway who created some of this with me for a course we run. ADB allows you to run various commands to a connected Android device via USB or WIFI.

Installation
I didn’t cover how to get it installed, but the documentation from Google is good, so just head over to the Android Studio site and follow their instructions. Once installed you’ll want to open the ‘SDK Manager’

and download a version of the Android SDK, I downloaded 8.1 as my phone is running 8.1. You’ll also want to download the following SDK Tools.

You’ll also want to add ADB to your ‘path’, lots of Google guides on how to do this, but you should eventually get to the point where you can write ‘ADB’ in your terminal and see lots of stuff like:

Android Debug Bridge version 1.0.40
Version 4797878
Installed as /Applications/android-sdk-macosx/platform-tools/adb

Configuring Your Device
Before you take advantage of ADB with your device, you need to enable USB Debugging. To do this you need to enable Developer options on your device. You have to go in to System > About Phone and tap the ‘Build number’ seven times. You should see a message saying ‘You are now a developer’. If you go back to System, you should now see an option called ‘Developer options’, go into there, scroll until you see the Debugging section and enable ‘USB debugging’. You’ll device will now be ready to receive ADB commands.

The first time you send a command, you’ll have to check a box on your phone that asks you if you trust the device sending commands, you only have to do this one per machine

Install an App
The first command we covered was

adb install /path/to/your/file.apk

This instructs ADB to download the apk file to your device and install it. Before I discovered this we were putting apks files in Google Drive and downloading them that way, it use to take me 90 seconds or so to do this, takes 10-15 with ADB. We also moved to HockeyApp, but again it took around 90 seconds to open HockeyApp, updates builds and click install.

Uninstall an App
If we can install we want to be able to uninstall!

adb shell pm uninstall com.package.name

There is a bit more involved in this one. Firstly we introduce ‘shell’ which gives us the ability to run shell commands directly on the device. We then call ‘pm’ which is short for Package Manager, the Android applications that you use when you uninstall apps on your device. Then we send the ‘uninstall’ command. Finally, we have to provide the name of the package, you can get this from the ‘manifest.xml’ in the source code of your app, if you don’t have access the developer should be able to give you this.

Update an App
Testing the update procedure of an app is really important, and ADB gives you a way to do this. We take the exact same command as install, but we add ‘-r’ to it, this instructs ADB to replace the existing app with this one.

adb install -r /path/to/your/file.apk

Clear App Data
If you have an app that you have to log into, or saves the users activity for example you sometimes want to clear that and redo a test. Or perhaps log in as another user. Or you want to test as a ‘new’ user, perhaps to see something like an onboarding screen. Before I discovered clear I was doing this by uninstalling and reinstalling the app, not anymore!

adb shell pm clear com.package.name

This command mimicks going into the App Infor and clicking Clear Data.

Taking Screenshots
I’m not ashamed to admit that for the early stages of mobile testing career I was taking screenshots by using the buttons on the phone, then uploading the screenshot to Google Drive or emailing it myself, not anymore!

adb shell screencap /sdcard/myscreenshot.png

This ADB command will take a screenshot and save it to where you specify on your device. But we need it on our computer! So,we take advantage of another ADB command:

adb pull /sdcard/myscreenshot.png

Pull will download the file from my device and save it in the directory I’m currently in on the Terminal.

With the help of Mark Collins, I turned this into a bash script, which I saved as a .sh (shell) file and added it to my /usr/local/bin folder on my Mac meaning I could call this script from anywhere in the Terminal. I’ve added the script to a Gist over on GitHub.

Recording Video
A nice feature I discovered from ADB is the ability to record your screen. This is great for enhancing your bug reports, especially with animation issues. And again, I’d previously done this by recording one phone with another :open_mouth:

adb shell screenrecord --bit-rate 6000000 /sdcard/myrecording.mp4

Again when you run this, you start it, do you action on the app, then stop it in the terminal and the mp4 will be saved to your phone, so then we have to download it to our computer like above.
I’ve also turned this into a script so it’s easier for me to utilise, you can also find this over on GitHub.

Bugreport
Android comes with a command called bugreport

adb bugreport

This is really helpful for your developers. It basically takes a dump of the phone including logs, memory, processes and much more. Majority of it made absolutely no sense to me, but my developers were very appreciative of recieving it.

Log Watching

adb logcat

This will print the logs from the device to the Terminal. Again very useful for enhancing your bug reports. You can also take advantage of BASH and tail this straight to a file, adb logcat > mylogs.txt.

Android Studio
All the above can be accessed without a Terminal using Android Studio if you prefer a GUI. With your device connected go to View > Tool Windows > Logcat.
From here you’ll be able to see the logs, take screenshots and record the app.

Android Profiler
The final thing I demoed was Android Profiler. You can find this like the above at View > Tools Windows > Android Profiler. With this you can monitor CPU, Memory and Network usage. I would regularly have this open while doing Exploratory Testing, as it would help me identify potential memory/CPU spikes, as well as excessive network usage which could cost our users a lot in data!

Summary
If you are testing Android applications, I strongly encourage you to explore ADB/Android Studio, it’s like having Android superpowers! Utilising ABD saved me hours, especially around installing new versions. I blogged about a nice solution using Appium and ADB a while back now. As well as the simple things of taking screenshots went from 60-90 seconds to 10. That time really adds up over a release!

Hello All,

My Talk/Demo was around Chrome Dev Tools, the features and useful extensions,

A few things I touched on regards DevTools were:

  • How to access Chrome Devs Tools

  • Changing the Doc side of the DevTools

  • How to view different device modes and device frames

  • Using inspect element

  • Over writing CSS on live websites

  • Forcing CSS states- :active :hover

  • Console tabs and looking for error

  • Network tab and what we can look for in the network tab

  • Application Panel - Clearing Site data

  • Network conditions - Throttling network

  • Sensors - Usage of Geolocation Over ride

Furthermore, I discussed and gave a quick demo on the following tools:

  • Grid Ruler

  • Check my links

  • What Font?

  • Notes Anywhere

  • Bug Magnet

  • Pixel Perfect

  • Page Load time

Accessing Dev Tools

To enter dev tools you can either;

1 – Press F12 on keyboard

2 – Ctrl + Shift + I

3 – Right click on web page and click inspect

- Changing the Doc side of the DevTools

To change the dock side, you can click the menu in the top right and select from any of the views
image

- How to view different device modes and device frames

To view the web page in different device modes, you can click the drop down where it says responsive and select a view
image
To view device frames, simply click the menu in your website page view and click ‘Show Device Frames’

image

- Using inspect element

To use inspect element, you will need to click the option on the top left of the dev tools,
image

Once selected you can then click any element on the webpage which will then bring back the HTML and styling rules for that element

- Over writing CSS on live websites

Over writing the CCS on live sites is not as complicated as you think, simply select the element you wish to change the styling on,

image

And you can over write/add/take out styling that you wish

image

Please note, once you refresh your browser all changes you’ve made will be revoked

- Forcing CSS states- :active :hover

If you have an element on your page which requires user interaction to view, an on-hover state for example, keeping your mouse on the webpage whilst trying to type notes on another can be a challenge, you can simply add a rule that forces the state,

All you need to do is select the element which has the on-hover/Active state, on the HTML part of the DevTools, right click, look for force state, hover over that then click your option,

image

This will them force the state on the element

- Application Panel - Clearing Site data

To clear site of all data, such as cookie and cache, you will need to navigate to the application tab in Dev tools,

Then you can select what data you want to clear and press clear Site data

- Network conditions - Throttling network

If you don’t already have the network conditions tab visible, you will need to enable it by clicking the dev tools menu, navigating to more tools and click Network conditions

image

Once you have the network conditions open, you then have the option to select a pre-set condition or the option to create your own, once you have selected an option, refresh your browser to see the webpage load with the conditions selected

image

A big thanks to all those who attended the demo and hopefully this will give you some good insight to DevTools and it gave you something to take away to look at,

Kieran

2 Likes

Hi all, for my session we discussed the basics of performance testing and I demonstrated a tool for creating load tests - Gatling.

Basics

So before showing anything about Gatling, I asked people what they understood about performance testing to gauge their level of experience. For those familiar or with some experience, I covered this in less detail and went straight to the tool and how it compared to others they may have used before.

The main topics discussed were:

  • What is "Performance Testing"?

  • What some different kinds of Performance Testing are (Performance, Load, Stress, Soak, Spike)

  • How can you conduct simple performance testing without heavyweight tools, e.g. using a Web Browser or Postman.

  • What your typical work looks like for a performance tester.

  • The importance of statistics, particularly using the Standard Deviation to analyse the accuracy of the Mean (Average) and figure out what happened during the test.

  • The value of graphs in helping figure out what happened and correlating events.

  • Why you ramp load and run load tests for significant amounts of time.

  • The importance of having isolated, understood, conifgurable and destructable test environments.

  • Why you don’t want to performance test 3rd parties.

The tool - Gatling

I demonstrated Gatling as an example of a tool you can use to conduct performance testing. You can create simulations in Gatling using a programming language called Scala so given the time constraints and range of experience I tried to explain how it generally works. I was hoping to show people that, even without much programming experience, they can understand what the tool is doing and how to change it.

The main aspects I covered were how to create requests, include them in scenarios (a bit like user stories) and then create simulations (the load test) using them.

I also showed how to run Gatling using a tool called Maven and the reports it generates.

If you would like to know more about how to use Gatling, their documentation is very good and will explain it much better than me:

Other tools
I also mentioned alternative tools to Gatling for creating performance tests, particularly Jmeter which is just as good as Gatling but uses a GUI and therefore requires less coding experience. If you are new to coding or unsure, I definitely recommend trying Jmeter out too.

There is also a Python-based tool called Locust which is gaining popularity, if you’re more comfortable with Python and want to use code still to design your tests, this may be a preferred alternative.

1 Like

Technical Testing SQL

  • What is SQL and what’s a DB
    Think Excel
  • Why would you want to use SQL
    Look under the hood - compare UI with DB
  • Have a go ?
    Download and play with a DB
  • Further info
    Help with SQL

What is SQL and what’s a DB
Think Excel
A DB table is just like an excel sheet, rows and columns
A DB has lots of tables
In a DB you can add, delete and update rows and columns
You can access or order the data by a key e.g name and/or Customer number
You can join tables together by using a common key, relationship
DBs can be big (PetaBytes),
and they can be very very fast e.g. a Data Warehouse
SQL is the language that helps you read and create/update data

Why would you want to use SQL

  1. Often the User Interface shows what is on the Database
    A chance to compare data shown in the UI with what same data on the DB

  2. Find test data
    Find customers with a balance of > 10,000
    Find customers with a postcode of M60 1AA
    Sometime UI or UI searches don’t exist or are not very good

  3. Prove that a search works
    Search using the UI
    Search using SQL
    Same results

  4. Prove that data really doesn’t exist
    Not on the UI

  5. Check boundary conditions
    Run SQL to find data on boundary
    See same data in UI

  6. Joins
    Inner and outer
    Sometimes you need an outer join so you can see what’s missing

  7. Counts - how any orders ? how many users ?
    select us.username ‘User Name’ , Count(*)
    from Orders or
    join users us on us.code = or.usercode
    where or.status = ‘OP’
    group by us.username
    order by us.username

  8. Find duplicates
    Sometimes a query may return duplicates
    e.g. Select * from Customer where Surname=‘Smith’ and Street=‘London Road’
    does the application deal with duplicates ?
    SELECT s.sid, s.name
    FROM Supplier s, Supplies su, Project pr
    WHERE s.sid = su.sid AND su.jid = pr.jid
    GROUP BY s.sid, s.name
    HAVING COUNT (DISTINCT pr.jid) >= 2

Want to have a go ?

  1. Download Microsoft SQL Server Express edition and install (for free)
    https://www.microsoft.com/en-gb/sql-server/sql-server-editions-express

  2. Download a sample DB Northwind
    https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/linq/downloading-sample-databases

  3. Open the sample DB in SQL Server Express Management Studio
    Help on the Microsoft site

  4. Or try MongoDB NoSQL Opensource
    Search for MongoDB dwonloads
    MongoDB is NoSQL and opensource

Further info - help with SQL

  1. Have a go

  2. Search SQL on the website stackoverflow

  3. Try asking the dev that you sit next to at work - probably very good at SQL

  4. Try asking the DBAs - definitely very good at SQL

1 Like