Showing posts with label CTS. Show all posts
Showing posts with label CTS. Show all posts

Friday, August 24, 2012



Software Testing:

1.Everything is better if you make your tests before you implement the features

Known testing tools are there.
QTP, LoadRunner, TestRunner

TestRunner which is based on JUnit testing framework.It is used in android CTS testcase. CTS is using XML file for configuring testcases/testcase sequence. Junit is nothing Java testcases.

Ant is a opensource tool to automate the building process. It will use XML to build.
It is similar to make .(make file).

     Android Application project creation & building without eclipse can be automated using Ant tool.


Junit reference:
http://pub.admc.com/howtos/junit3x/intro-chapt.html

Using Ant to build android application project reference:
http://developer.android.com/tools/building/building-cmdline.html
http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html

2.Monkey runner tool -Python based module which can control the device complete.
3.Monkey tool- UI/Application excerciser which can generate touch events random generator
which can be used for UI stress tool

4.Software testing books;
  i)Testing computer software
  ii) Lessons learned software testing
  iii)Automated testing -Introduction management and performance

5.Android CTS result
   Android CTS result xml has 3 states.
 
   i)Passed Testcases
   ii)Failed Testcases
   iii)NotExecuted testcases

   Testcases are listed under "NotExecuted" if it is not executed. This can happen only when Virtual machine is crashed and CTS testsuite is not able to proceed further testcases.

 Assume we have 10 testcases.First 3 testcases are passed. while running 4th testcase java virtual machine is crashed.Then CTS tool wont be able to communicate with the VM, so CTS result xml will list as follows:

  Passed testcases:3
  Failed testcases:0
  Not Executed    :7
 
 
6.Teraterm

  Kermit- can be used for bootstrap.supports transfer of text and binary file over serial communication
  X modem -file transfer protocol with Cyclic redundancy check
  Y modem -  allows multiple batch file transfer

7.JFFS2- support for NAND flash devices
  UBIFS- successor to JFFS2, it supports write caching.
      performs better when large raw flash NAND devices,Directory contents are using B+ trees.

8.Android camera:

Android camera HAL module is available in Camera.default.so library.

 Android camera module has 4 components:
   i)Camera client
   ii)Camera service
   iii)Camera HAL module
   iv) Camera driver
  Camera client talks to the cameraservice.Cameraservice talks to camera HAL module.
Camera HAL module talks to camera driver.

reference:
http://marakana.com/static/courseware/android/Aptina-Android-Camera-Internals.pdf

9. Three Components of android adb:
   1.adb server [running on Desktop machine, adb start-server, adb kill-server to start and kill adb server, it is also called as adb host daemon]
   2.adb client [running on Desktop machine, adb logcat ]
   3.adb daemon [running on Android device which will receives data through ports from adb server, can also be mentioned as adb target daemon]
     
10. JDB which can be used to debug android applications



Tuesday, August 21, 2012


I)What is CTS ?
II)CTS components
III)How to Run CTS from end user level?
IV)How to run CTS from Windows?
V)CTS binaries and source code structure


I)Why we need CTS ?
 
CTS testcases tests whether any android apis are modified or any changes done in android that is not compliant to android standard.
Google approves binary only when all CTS testcases are successful. For google approval process,
CTS test cases are executed on device and output .xml is sent to google team.

They will also run the CTS testcases from their end. If there is no failure, then they will approve the binary for the release.
Most of the Mobile operators will expect that the binary should be approved by google.

For some failure cases, we can get a waiver from google. For example, if it is a android DTV/Setupbox, then there wont be any GPS device in it.So all the GPS testcases will fail or not applicable for that device. Waiver request should be reasonable.

II) CTS components:
    CTS is an automated testing application that includes two major components
 1)CTS test application runs on desktop & manages test execution]
 2)Junit testcases running on Mobile or emulator or android device
  JUnit testcases are written in Java and packaged in Android.apk files to run on target device[emulator or android device].
 
III)How to run CTS from end user level?
   1.CTS can be run from Source code in linux
     
 if we have android source code, android/CTS folder will be there.
 we can compile CTS by following steps

 source build/envsetup.sh
 lunch sdk-eng
 make cts 

 Once the compilation is over, we can run
 >cts-tradefed 
 from command line.
 From cts-tradefed it will gives cts prompt.In cts prompt,
 type "list devices" to list the connected devices/emulator.You can refer the android cts document for    more information on list of commands.

 [cts-tradefed binary will be available in out/host/linux-x86/bin/cts/android-cts/tools/]
 cts-tradefed is a script file to run JUnit testcases.

     
   2.CTS can be run from downloaded binary  
         we have to download android compatiblity test suite from android site.

we have to configure this folder in PATH variable
and then we can run
 cts-tradefed in commandline.
     

 IV)How to run CTS from Windows ? Is it possible ?
      It is possible to run CTS from windows.
 Reason:
 "JUnit testcases are written in Java and packaged in Android.apk files to run on target device" from android cts manual.

 cts-tradefed is a script which will configures java to run Junit testcases.

 Configure CTS in Windows OS:

 Step1: adb path should be configured in PATH variable and "adb devices" should list down the devices.
 Step 2:
    cts-tradefed script will contains the following lines:


CTS_ROOT=${ANDROID_BUILD_TOP}/out/host/${OS}/cts
    JAR_DIR=${CTS_ROOT}/android-cts/tools
JARS="ddmlib-prebuilt.jar tradefed-prebuilt.jar hosttestlib.jar cts-tradefed.jar"

for JAR in $JARS; do
checkFile ${JAR_DIR}/${JAR}
JAR_PATH=${JAR_PATH}:${JAR_DIR}/${JAR}
done

   java -cp ${JAR_PATH} -DCTS_ROOT=${CTS_ROOT} com.android.cts.tradefed.command.CtsConsole

Assume that I have downloaded "android-cts-4.0.3_r3-linux_x86-arm.zip"  and unzipped it

My folder structure will be as follows:D:\android-cts-4.0.3_r3-linux_x86-arm\android-cts\tools
The simplification of this script is as follows for windows:

java -Xmx512M -cp D:\android-cts-4.0.3_r3-linux_x86-arm\android-cts\tools\cts-tradefed.jar;D:\android-cts-4.0.3_r3-linux_x86-arm\android-cts\tools\hosttestlib.jar;D:\android-cts-4.0.3_r3-linux_x86-arm\android-cts\tools\ddmlib-prebuilt.jar;D:\android-cts-4.0.3_r3-linux_x86-arm\android-cts\tools\tradefed-prebuilt.jar -DCTS_ROOT=D:\android-cts-4.0.3_r3-linux_x86-arm\   com.android.cts.tradefed.command.CtsConsole

run this command in commandline then you will get cts prompt in windows OS too.

-cp is the class search path for the zip or jar files. whenever some class is encountered in jar file,java will look for it in class search path.
CTS_ROOT will be used internally in jar files, so we are setting CTS_ROOT by -DCTS_ROOT.
CTS_ROOT is D:\android-cts-4.0.3_r3-linux_x86-arm. not a D:\android-cts-4.0.3_r3-linux_x86-arm\android-cts.[by giving this, i got errors]


V) CTS Binaries & source code structure:
          1)cts-tradefed.jar source code path is "android_source_path/cts"
 2)hosttestlib.jar
 3)Junit.tar
          4)ddmlib-prebuilt.jar
          5)tradefed-prebuilt.jar

 ddmlib-prebuilt.jar and tradefed-prebuilt.jar is available as prebuilt binaries. No source code available

 tradefed-prebuilt.jar is a CTS component runs on Desktop machine and manages test execution. platform/tools/tradefederation is the source code folder path for tradefed-prebuilt.jar file.