'Technical Note/TEST AUTOMATION'에 해당되는 글 11건

Technical Note/TEST AUTOMATION

TestNG는 단위테스트를 비롯하여 기능테스트, 통합테스트, 인수테스트 등 모든 범주의 테스트를 지원하는 것을 추구한다. JUnit보다 더욱 유연하고 쉬운 테스트가 가능하며, 효율적인 테스트를 위한 많은 기능들을 제공하고 있다. 차세대 자바 테스팅 엔진으로서 손색이 없는 TestNG의 사용법을 예제를 통해 알아본다.

1. 기본 테스트 예제

import org.testng.Assert;
import org.testng.annotations.Test;

public class SimpleTest {
	private int x = 2;
	private int y = 3;

	@Test
	public void testAddition() {
		int z = x + y;
		Assert.assertEquals(5, z);
	}

	@Test(groups = { "fast" })
	public void aFastTest() {
		System.out.println("Fast test");
	}

	@Test(groups = { "slow" })
	public void aSlowTest() {
		System.out.println("Slow test");
	}
}

- @Test 어노테이션을 사용하여 테스트 메소드를 정의하고, Assert 구문을 사용하여 테스트를 검증한다.
- JUnit과는 다르게 테스트 메소드를 groups 파미미터 지정으로 특정 그룹으로 지정할 수 있다.
- 이렇게 지정된 그룹은 이후에 그룹별 실행이나 종속성을 갖도록 설정되어질 수도 있다.

- 아래는 테스트를 수행한 한 예로 testng.xml 파일을 이용한 것이다. 결과는 콘솔에 보여준다.

C:\TestingWorks\TestNG01>java org.testng.TestNG testng.xml
[Parser] Running:
  D:\WORKS\TestingWorks\TestNG01\temp-testng-customsuite.xml

Slow test
Fast test
PASSED: aSlowTest
PASSED: testAddition
PASSED: aFastTest

===============================================
    SimpleTest
    Tests run: 3, Failures: 0, Skips: 0
===============================================


===============================================
TestNG01
Total tests run: 3, Failures: 0, Skips: 0
===============================================


- 테스트 수행은 다양하게 설정되어 질 수 있는데, 위 테스트의 testng.xml의 내용이다.

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="TestNG01">
  <test verbose="2" name="SimpleTest" annotations="JDK">
    <classes>
      <class name="testing.testng.SimpleTest"/>
    </classes>
  </test>
</suite>


2. 테스트 메소드 실행 전/후에 처리작업 수행하기

import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterGroups;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class BeforeAfterTest {

	@BeforeSuite
	public void beforeSuite() {
		System.out.println("@BeforeSuite");
	}

	@AfterSuite
	public void afterSuite() {
		System.out.println("@AfterSuite");
	}

	@BeforeTest
	public void beforeTest() {
		System.out.println("@BeforeTest");
	}

	@AfterTest
	public void afterTest() {
		System.out.println("@AfterTest");
	}

	@BeforeClass
	public void beforeClass() {
		System.out.println("@BeforeClass");
	}

	@AfterClass
	public void afterClass() {
		System.out.println("@AfterClass");
	}

	@BeforeGroups(groups = { "fast" })
	public void beforeGroups() {
		System.out.println("@BeforeGroups: fast");
	}

	@AfterGroups(groups = { "fast" })
	public void afterGroups() {
		System.out.println("@AfterGroups: fast");
	}

	@BeforeMethod
	public void beforeMethod() {
		System.out.println("@BeforeMethod");
	}

	@AfterMethod
	public void afterMethod() {
		System.out.println("@AfterMethod");
	}

	@Test(groups = { "fast" })
	public void aFastTest() {
		System.out.println("Fast test");
	}

	@Test(groups = { "slow" })
	public void aSlowTest() {
		System.out.println("Slow test");
	}
}

- TestNG는 테스트 수행시 다양한 스코프의 전/후 처리작업을 설정할 수 있다.
- 실행 전 순서: @BeforeSuite -> @BeforeTest -> @BeforeClass -> @BeforeGroups -> @BeforeMethod
- 실행 후 순서: @AfterMethod -> @AfterGroups -> @AfterClass -> @AfterTest -> @AfterSuite

- 아래는 테스트를 수행시 아래와 유사한 결과를 볼 수 있다.

[Parser] Running:
  C:\TestingWorks\TestNG01\temp-testng-customsuite.xml

@BeforeSuite
@BeforeTest
@BeforeClass
@BeforeMethod
Slow test
@AfterMethod
@BeforeGroups: fast
@BeforeMethod
Fast test
@AfterMethod
@AfterGroups: fast
@AfterClass
@AfterTest
PASSED: aSlowTest
PASSED: aFastTest

===============================================
    testing.testng.study02.BeforeAfterTest
    Tests run: 2, Failures: 0, Skips: 0
===============================================

@AfterSuite

===============================================
TestNG01
Total tests run: 2, Failures: 0, Skips: 0
===============================================


3. 테스트 그룹 지정을 통한 보다 유연한 테스트하기

import org.testng.annotations.Test;

@Test(groups = {"func-test"})
public class GroupTest {
	@Test(groups = { "fast" })
	public void aFastTest() {
		System.out.println("Fast test");
	}

	@Test(groups = { "slow", "broken" })
	public void aSlowTest() {
		System.out.println("Slow test");
	}
}

- 테스트 그룹은 메소드와 클래스 레벨 모두 지정할 수 있고, 클래스 레벨에서 지정된 그룹(func-test)은 해당 클래스내의 모든 테스트 메소드들이 속한 대한 그룹이 된다.
- 테스트 설정파일 testng.xml을 통해 테스트 코드가 완성되지 않은 특정 그룹에 속한 메소드는 테스트에서 제외할 수도 있다.

- 아래 예는 "fast" 그룹에 속한 메소드만을 실행하며, "broken" 그룹에 속한 메소드는 실행에서 제외한다.

<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
<suite name="Simple Suite">
  <test name="Test2">
    <groups>
      <run>
        <include name="fast" />
        <exclude name="broken" />
      </run>
    </groups>
  </test>
</suite>


4. 테스트 메소드 및 그룹간 종속성 지정을 통한 단위테스트 넘어서기

import org.testng.annotations.Test;

public class MethodDependencyTest {
	@Test
	public void serverStartedOk() {
		System.out.println("serverStartedOk");
	}

	@Test(dependsOnMethods = { "serverStartedOk" })
	public void testMethod1() {
		System.out.println("testMethod1");
	}
}

- 테스트 메소드간 종속성을 지정하여 테스트 메소드간의 실행 순서를 지정할 수 있다.

import org.testng.annotations.Test;

public class GroupDependencyTest {
	@Test(groups = { "init" })
	public void serverStartedOk() {
		System.out.println("serverStartedOk");
	}

	@Test(groups = { "init" })
	public void initEnvironment() {
		System.out.println("initEnvironment");
	}

	@Test(dependsOnGroups = { "init.*" })
	public void testMethod1() {
		System.out.println("testMethod1");
	}
}

- 테스트 그룹간 종속성을 지정하여 해당 그룹에 지정된 테스트의 실행 순서를 지정할 수 있다.
- 그룹명 및 메소드명 지정시 정규표현식을 이용할 수 있다. 위 예에서 init.*는 init로 시작하는 모든 그룹을 의미한다.

5. 예외처리 테스트하기 

import org.testng.annotations.Test;

public class ExceptionTest {
	@Test(expectedExceptions = { ArithmeticException.class })
	public void divisionByZero() {
		int n = 2 / 0;
		System.out.println(n);
	}

	@Test(expectedExceptions = { NumberFormatException.class })
	public void parseInteger() {
		int n = Integer.parseInt("two");
		System.out.println(n);
	}
}

- 기대되어지는 예외 클래스와 동일한 예외가 발생되면 성공으로 간주한다. 예외 클래스는 1개이상 지정할 수 있다.

6. 타임아웃 테스트하기 

import java.util.Random;
import org.testng.annotations.Test;

public class TimeOutTest {
	@Test(timeOut = 2000)
	public void testServer() throws Exception {
		Random rand = new Random();
		long responseTime = rand.nextInt(3000);
		System.out.println(responseTime);
		Thread.sleep(responseTime);
	}
}

- 지정된 시간안에 정상적으로 처리되면 성공이고, 그렇지 않으면 실패로 간주된다. 

7. 지정된 회수만큼 반복 테스트 수행하기 

import org.testng.annotations.Test;

public class RepeatedTest {
	@Test(invocationCount = 5)
	public void testServer() {
		System.out.println("accessPage");
	}
}

- 지정된 회수만큼 반복하여 테스트를 수행한다. 

8. 지정된 쓰레드 개수만큼 테스트를 병렬로 수행하기 

import java.util.Random;

import org.testng.annotations.Test;

public class ParallelRunningTest {
	@Test(threadPoolSize = 5, invocationCount = 10, timeOut = 2000)
	public void testServer() throws Exception {
		System.out.println(Thread.currentThread().getId());

		Random rand = new Random();
		long responseTime = rand.nextInt(3000);
		System.out.println(responseTime);
		Thread.sleep(responseTime);		
	}
}

- 테스트 반복 수행시 테스트 수행속도 향상을 위해 지정된 쓰레드 개수만큼 병렬로 테스트를 수행한다. 

9. 파라미터를 이용한 테스트 수행하기 

import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

public class ParameterTest {
	@Parameters( { "first-name" })
	@Test
	public void testSingleString(String firstName) {
		System.out.println("Invoked testString " + firstName);
		assert "Sehwan".equals(firstName);
	}
}

- @Parameters 어노테이션으로 지정된 파라미터들에 대해서 testng.xml 파일로부터 값을 얻어와 테스트를 수행할 수 있다.

- testng.xml 의 파라미터 설정 예는 아래와 같다.

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="TestNG01">
  <test name="Test1">
    <parameter name="first-name" value="Sehwan" />
    <classes>
      <class name="testing.testng.ParameterTest" />
    </classes>
  </test>  
</suite>


10. DataProvider를 이용한 Data-Driven 테스트 수행하기 

import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

public class DataProviderTest {
	@Test(dataProvider = "dp")
	public void verifyData1(String n1, Integer n2) {
		System.out.println(n1 + " " + n2);
	}

	@DataProvider(name = "dp")
	public Object[][] createData() {
		return new Object[][] { { "John", new Integer(34) },
				{ "Jane", new Integer(31) }, };
	}
}

- @DataProvider을 통해 2차원 배열형태로 데이터를 제공자하는 메소드를 정의한다.
- 테스트 메소드는 이 Data Provider를 이용하여 미리 정의된 데이터 집합을 가지고 반복적인 테스트를 수행할 수 있다.

import java.lang.reflect.Method;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

public class DataProviderParamTest {
	@Test(dataProvider = "dp")
	public void testData1(String s) {
		System.out.println(s);
	}

	@Test(dataProvider = "dp")
	public void testData2(String s) {
		System.out.println(s);
	}

	@DataProvider(name = "dp")
	public Object[][] createData(Method m) {
		System.out.println(m.getName());
		return new Object[][] { { "Hello" } };
	}
}

- Data Provider를 이용하는 테스트 메소드들에 대한 참조를 할 수 있다.

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

public class DataProviderIteratorTest {

	@Test(dataProvider = "dp")
	public void verifyData1(String n1, Integer n2) {
		System.out.println(n1 + " " + n2);
	}

	@DataProvider(name = "dp")
	public Iterator<Object[]> createData() {		
		List<Object[]> list = new ArrayList<Object[]>();
		list.add(new Object[] {"John", new Integer(34)});
		list.add(new Object[] {"Jane", new Integer(31)});
		return list.iterator();
	}
}

- 이차원 배열이 아닌 Iterator 타입의 데이터 집합을 반환하는 Data Provider를 만들 수 있다.
- 이 방식은 Lazy Loading을 통해서 메모리 부족에 대한 좋은 해결책을 제공할 수 있다.

import org.testng.annotations.Test;

public class StaticDataProviderTest {
	@Test(dataProvider = "dp", dataProviderClass = StaticDataProvider.class)
	public void test(Integer n) {
		System.out.println("Number:" + n);
	}
}

- Data Provider를 테스트 클래스 밖으로 꺼내어 별도의 클래스로 만들어서 이용할 수 있다.
- 동일한 Data Provider를 이용하는 테스트 클래스가 여럿일 경우 유용하게 쓰일 수 있다.

import org.testng.annotations.DataProvider;

public class StaticDataProvider {
	@DataProvider(name = "dp")
	public static Object[][] createData() {
		return new Object[][] { new Object[] { new Integer(42) } };
	}
}


Technical Note/TEST AUTOMATION

maven 프로젝트를 실행하려고 하니 "Unsupported major.minor version 51.0" 와 같은 에러가 났다 


---- 에러 내용 ----

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project TestAutomationScript: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test failed: There was an error in the forked process

[ERROR] java.lang.UnsupportedClassVersionError: io/appium/java_client/AppiumDriver : Unsupported major.minor version 51.0

[ERROR] at java.lang.ClassLoader.defineClass1(Native Method)

[ERROR] at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)

[ERROR] at java.lang.ClassLoader.defineClass(ClassLoader.java:621)

[ERROR] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

[ERROR] at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

[ERROR] at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

[ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

[ERROR] at java.security.AccessController.doPrivileged(Native Method)

[ERROR] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

[ERROR] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

[ERROR] at java.lang.Class.getDeclaredMethods0(Native Method)

[ERROR] at java.lang.Class.privateGetDeclaredMethods(Class.java:2484)

[ERROR] at java.lang.Class.privateGetPublicMethods(Class.java:2604)

[ERROR] at java.lang.Class.getMethods(Class.java:1446)

[ERROR] at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:59)

[ERROR] at org.testng.TestRunner.initMethods(TestRunner.java:409)

[ERROR] at org.testng.TestRunner.init(TestRunner.java:235)

[ERROR] at org.testng.TestRunner.init(TestRunner.java:205)

[ERROR] at org.testng.TestRunner.<init>(TestRunner.java:153)

[ERROR] at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:536)

[ERROR] at org.testng.SuiteRunner.init(SuiteRunner.java:159)

[ERROR] at org.testng.SuiteRunner.<init>(SuiteRunner.java:113)

[ERROR] at org.testng.TestNG.createSuiteRunner(TestNG.java:1299)

[ERROR] at org.testng.TestNG.createSuiteRunners(TestNG.java:1286)

[ERROR] at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)

[ERROR] at org.testng.TestNG.run(TestNG.java:1057)

[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:217)

[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)

[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:92)

[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)

[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)

[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)


원인을 찾아보니

컴파일때 사용된 JDK버전과 실행시 사용되는 JDK 버전이 다르다고 했다


정말 mvn -version을 하니 java home의 경로가 jdk 1.6을 바라보고 있는것이 아닌가?

.bash_profile에서 java home을 jdk 1.7로 변경하니 문제가 해결되었다



Technical Note/TEST AUTOMATION

If you want to select a different TestNG test suite .xml files to run test from you can do the following in the pom.xml file:

01
02
03
04
05
06
07
08
09
10
11
12
13
14
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.13</version>
    <configuration>
        <forkMode>always</forkMode>
        <systemPropertyVariables>
            <reporter.debug>false</reporter.debug>                     
        </systemPropertyVariables>
        <suiteXmlFiles>
            <suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
        </suiteXmlFiles>
    </configuration>
</plugin>

You can however add a specific test suite file to a Maven property:

1
2
3
<properties>
     <suiteXmlFile>testng.xml</suiteXmlFile>
 </properties>

To run the tests from a particular TestNG test suite file you can run the following command from terminal:

1
mvn clean test -DsuiteXmlFile=custom.xml


Technical Note/TEST AUTOMATION

adb -d logcat <your package name>:<log level> *:S

adb -d logcat com.example.example:I



adb shell threadtime

http://shinluckyarchive.tistory.com/487




net.daum.entertainment.music.android



os 버전 : adb shell getprop ro.build.version.release

모델명 : adb shell getprop ro.product.model

시리얼 넘버 : adb get-serialno

sdk  버전 : adb shell getprop ro.build.version.sdkㅡㅐ



Device 정보

Android 모델 

OS  Version

Serial Number

SDK Version




출처 : http://ecogeo.tistory.com/256


안드로이드 시스템 분석에 사용할만한 shell 명령을 알아보자.


시스템 기본 정보: 하드웨어, 커널 등


cat /proc/version : 커널 버전

cat /proc/cpuinfo : 프로세서 정보. CPU 타입, 모델, 제조사 등

cat /proc/meminfo : 메모리 정보. 실제 메모리 및 가상 메모리

cat /proc/devices : 현재 커널에 설정되어 있는 장치 목록

mount : 마운트된 모든 장치 정보

df : 하드디스크 사용량

cat /proc/filesystems : 커널에 설정되어 있는 파일시스템 목록

cat /proc/swaps : 스왑 파티션의 크기와 사용량

cat /proc/interrupts : 장치가 사용중인 인터럽트(IRQ) 목록 표시

cat /proc/ioports : 현재 사용중인 Input/Output 포트

cat /proc/loadavg : 시스템의 평균부하량

cat /proc/partitions : 파티션 정보

cat /proc/uptime : 시스템이 얼마나 살아있었는지.

cat /proc/stat : 시스템 상태에 관한 다양한 정보. CPU 사용통계, 부팅이후 page fault 발생횟수 등

cat /proc/zoneinfo : ZONEINFO ?

dmesg : 시스템 부팅시 나왔던 메시지

ps : 실행중인 프로세스 정보

ps -p -t : 프로세스와 쓰레드 목록

set 또는 printenv : 환경설정값 출력


시스템 리소스 사용 현황


vmstat : 시스템의 리소스 상황 모니터링. CPU, I/O, 메모리 등

cat /proc/diskstats : 디스크 utilization과 throuthput. 즉 디스크 IO 현황

top : 시스템의 프로세스 상황 모니터링. 프로세스별 CPU 사용량, 메모리와 스왑 사용량 등

procrank : 프로세스별 메모리(VSS,RSS,USS, PSS)

dumpsys meminfo [PID] : 해당 프로세스의 메모리 상세 정보

cat /proc/[PID]/stat : 해당 프로세스에 대한 정보. 시작시간, 상태, CPU 사용량 등

cat /proc/[PID]/maps : 해당 프로세스의 메모리 맵 정보

cat /proc/vmstat : 버추얼 메모리 통계?

librank : 라이브러리별 메모리 사용량?


네트워크 관련


cat /proc/net/netlink : 네트워크 정보

netcfg : 네트워크 인터페이스와 IP주소 목록

netstat : 네트워크 연결상태 확인

nc : 네트워크용 cat 명령어(netcat)

ifconfig : 네트워크 인터페이스 설정 정보. 장치명을 파라미터로 받음. IP 주소, 서브넷마스크 등

tcpdump : 실시간 패킷 모니터링

iftop : 네트워크를 위한 top

route : 해당 호스트까지 연결하는 중간 경로 정보인 라우팅 테이블 표시

ping : 원격 호스트와의 연결 테스트

cat /proc/net/route : Routes


안드로이드 제공


logcat : 로그캣 보기

pm : package manager의 약자. 패키지/permission/instrumentation/feature 목록, 패키지 설치/제거 등

am : activity manager의 약자. 액티비티 시작, Intent 브로드캐스팅, Instrumentation 시작, profiling 시작/중지 등

service : 안드로이드 서비스 목록 표시, 서비스에 명령 전달

monkey : 애플리케이션에 랜덤 이벤트 발생시킴. 사용자 이벤트, 시스템 이벤트의 무작위 발행

cat /data/anr/traces.txt : VM TRACES (쓰레드 덤프)

cat /proc/binder/proc/[PID] : 바인더 프로세스 상태

cat /proc/binder/xxx : 바인더 관련 정보(xxx는 transactions, transaction_log, failed_transaction_log, stats 등)

cat /data/system/packages.xml : 설치된 패키지 세팅 정보

setprop : system property 세팅

getprop : 세팅된 system property 목록 출력



종합 리포트

dumpsys [service]: app/service 상태정보 덤프. 서비스별로 추가 파라미터 받을 수 있음

dumpstate : device 상태정보 덤프(cpu,mem,ps 등). 상태정보를 추출하는 여러 명령어들의 조합으로 구성

dumpcrash : 애플리케이션이 crash될 때의 상태정보 덤프?

bugreport : logcat+dumpsys+dumpstate


그밖에...

그밖의 안드로이드 shell 명령어는 /system/bin 및 /system/xbin을 뒤져보면 많이 나온다. 이제 남은 일은 찾아낸 명령어의 사용법, 출력결과를 어떻게 해석할지, 어떤 상황에서 이들을 활용할지 사례조사, 그리고 직접 활용해보는 것일게다.




* 참조


http://www.cyworld.com/polox94ii/312644


http://tkhwang.pe.kr/archives/65


http://en.androidwiki.com/wiki/ADB_Shell_Command_Reference


http://elinux.org/Using_Bootchart_on_Android


http://elenoa.tistory.com/52









*** Android Debug ***


* Kernel Debug

=====================================================

* adb shell

- cat proc/kmsg : kernel 로그 메세지를 볼 수 있음.


   adb devices 로 폰 연결확인

   adb shell

   > cat /proc/kmsg&  커널메시지 나옴 ex: <number>형식

   > logcat&          플랫폼메시지 나옴 

   adb logcat -b radio > xxx.txt 릴 로그


dmesg : 가장 최근 메세지 출력

=====================================================


* kernel message 찍기 (파일이름, 함수이름, 라인넘버)

=====================================================

printk(KERN_ERR "%s : %s : %d \n, __FILE__, __func__, __LINE__)

=====================================================


* 부팅시 Serial 로 메세지 찍는 방법

=====================================================

setenv SWITCH_SEL 3

saveenv


로그 레벨 변경하는 방법

----

setenv CMDLINE console=ttySAC2,115200 loglevel=7

saveenv


현재 상태 보는 방법

----

printenv



=====================================================


* emergency mode 들어가는 법: anyway function 부분 2,6번 내리고 폰연결하면 들어간다.




- wake lock 보는 방법

---------

#cat /sys/power/wake_lock



- wake unlock 보는 방법

---------

#cat /sys/power/wake_unlock



- wake lock setting 방법

---------

#echo test > /sys/power/wake_lock



- wake unlock setting 방법

---------

#echo test > /sys/power/wake_unlock



- 현재 wake lock 보는 방법

---------

#cat /proc/wakelocks


- Threads 보는 방법

---------

#ps

#ps -t


- Thread 죽이는 방법

---------

#kill "PID"

#kill -9 "PID"


- dumpsys 보는 방법

---------

#dumpsys power

#dumpsys alarm



- 의심되는 Thread 가 있을 경우에 확인 방법

의심되는 Thread의 PID를 확인후에

#cd proc

#cd "PID"

#cat wchan (현재 상태 확인)

#cat cmdline (매개변수 확인)


-속성 변경하는 방법 (read, write)

-----------------------------

    chown system system /data

    chmod 0771 /data

-----------

위 부분의 속성을 system으로 바꿔서 read write 가능하게 하려면~

-----------------------------

    chown system system /system

    chmod 0771 /system

-----------

이렇게 하면 apk 파일을 지울수 있다.



adb logcat  -v time -b main -b radio -b events -b system 2>&1|tee 00_logcat.log 


Technical Note/TEST AUTOMATION

최근 여기저기 전 세계의 뉴스그룹들을 자주 뒤져보며 즐거워하고 있습니다. 




업무 시간 중 쉬는 시간 20분 정도를 쪼개어, 외국에서 같은 업무에 종사하는 분들이 나누는 이야기들을 훔쳐보며 많이 배우고, 한국에서 그리고 세계에서 제가 어느 정도까지 와 있는지 생각해 봅니다. 뉴스 그룹은 최근의 화두로 여기저기서 급부상중인 Agile에 관련된 뉴스와 제 업무인 Quality Engineering 분야의 뉴스들의 정보들을 즐겨보고 있습니다.




뉴스 그룹에서 아래의 URL이 와서 읽어 보니 상당히 재미있는 글이 포스팅되어 있습니다.


http://www.forum.onestoptesting.com/forum_posts.asp?TID=1612


나름대로 외국 족보.. 랄까요?




아래의 내용은 Automation Testing에 대한 질문과 그에 대한 모범 답안 정도인 듯 합니다. 제가 보기에도 딱히 짚고 넘어가야 할게 없을 정도로 무난~~~하니 좋은 것 같습니다. 이것으로 Automation에 대한 전부를 알 수는 없겠습니다만, 적어도 인터뷰라는 것을 감안하면 무난한 답들이라 생각합니다.




굳이 Automation이 아니라도 다른 내용들도 담겨 있으니, 공부가 필요하신 분들에겐 좋은 자료가 될 것 같습니다.




어차피 Test Automation에 관심을 가지는 사람들은 영어 독해가 가능할 것 같아서 번역은 하지 않습니다.




----------------------------------------------------------------------------------------------------




1. What automating testing tools are you familiar with? 


Win Runner , Load runner, QTP , Silk Performer, Test director, Rational robot, QA run. 




2. How did you use automating testing tools in your job? 


1) For regression testing 


2) Criteria to decide the condition of a particular build 




3. Describe some problem that you had with automating testing tool. 


The problem of winrunner identifying the third party controls like infragistics control. 




4. How do you plan test automation? 


1) Prepare the automation Test plan 


2) Identify the scenario 


3) Record the scenario 


4) Enhance the scripts by inserting check points and Conditional Loops 


5) Incorporated Error Hnadler 


6) Debug the script 


7) Fix the issue 


8) Rerun the script and report the result. 




5. Can test automation improve test effectiveness? 


Yes, Automating a test makes the test process: 


1) Fast 


2) Reliable 


3) Repeatable 


4) Programmable 


5) Reusable 


6) Comprehensive 




6. What is data - driven automation? 


Testing the functionality with more test cases becomes laborious as the functionality grows. For multiple sets of data (test cases), you can execute the test once in which you can figure out for which data it has failed and for which data, the test has passed. This feature is available in the WinRunner with the data driven test where the data can be taken from an excel sheet or notepad. 




7. What are the main attributes of test automation? 


software test automation attributes : 


Maintainability - the effort needed to update the test automation suites for each new release 


Reliability - the accuracy and repeatability of the test automation 


Flexibility - the ease of working with all the different kinds of automation test ware 


Efficiency - the total cost related to the effort needed for the automation 


Portability - the ability of the automated test to run on different environments 


Robustness - the effectiveness of automation on an unstable or rapidly changing system 


Usability - the extent to which automation can be used by different types of users 




8. Does automation replace manual testing? 


There can be some functionality which cannot be tested in an automated tool so we may have to do it manually. therefore manual testing can never be repleaced. (We can write the scripts for negative testing also but it is hectic task).When we talk about real environment we do negative testing manually. 




9. How will you choose a tool for test automation? 


choosing of a tool deends on many things ... 


1) Application to be tested 


2) Test environment 


3) Scope and limitation of the tool. 


4) Feature of the tool. 


5) Cost of the tool. 


6) Whether the tool is compatible with your application which means tool should be able to interact with your appliaction 


7) Ease of use 




10. How you will evaluate the tool for test automation? 


We need to concentrate on the features of the tools and how this could be benficial for our project. The additional new features and the enhancements of the features will also help. 




11. What are main benefits of test automation? 


FAST ,RELIABLE,COMPREHENSIVE,REUSABLE 




12. What could go wrong with test automation? 


1) The choice of automation tool for certain technologies 


2) Wrong set of test automated 




13. How you will describe testing activities? 


Testing activities start from the elaboration phase. The various testing activities are preparing the test plan, Preparing test cases, Execute the test case, Log teh bug, validate the bug & take appropriate action for the bug, Automate the test cases. 




14. What testing activities you may want to automate? 


1) Automate all the high priority test cases which needs to be exceuted as a part of regression testing for each build cycle. 




15. Describe common problems of test automation. 


The commom problems are: 


1) Maintenance of the old script when there is a feature change or enhancement 


2) The change in technology of the application will affect the old scripts 




16. What types of scripting techniques for test automation do you know? 


5 types of scripting techniques: 


Linear 


Structured 


Shared 


Data Driven 


Key Driven 




17. What are principles of good testing scripts for automation? 


1) Proper code guiding standards 


2) Standard format for defining functions, exception handler etc 


3) Comments for functions 


4) Proper errorhandling mechanisms 


5) The apprpriate synchronisation techniques 




18. What tools are available for support of testing during software development life cycle? 


Testing tools for regressiona and load/stress testing for regression testing like, QTP, load runner, rational robot, winrunner, silk, testcomplete, Astra are availalbe in the market. -For defect tracking BugZilla, Test Runner are availalbe. 




19. Can the activities of test case design be automated? 


As I know it, test case design is about formulating the steps to be carried out to verify something about the application under test. And this cannot be automated. IHowever, I agree that the process of putting the test results into the excel sheet. 




20. What are the limitations of automating software testing? 


Hard-to-create environments like “out of memory”, “invalid input/reply”, and “corrupt registry entries” make applications behave poorly and existing automated tools can’t force these condition - they simply test your application in “normal” environment. 




21. What skills needed to be a good test automator? 


1) Good Logic for programming. 


2) Analatical sklls. 


3) Pessimestic in Nature. 




22. How to find that tools work well with your existing system? 


1) Discuss with the support officials 


2) Download the trial version of the tool and evaluate 


3) Get suggestions from peopel who are working on the tool 




23. Describe some problem that you had with automating testing tool. 


1) The inabality of winrunner to identify the third party control like infragistics controls 


2) The change of the location of the table object will cause object not found error. 


3) The inability of the winrunner to execute the script against multiple langauges 




24. What are the main attributes of test automation? 


Maintainability, Reliability, Flexibility, Efficiency, Portability, Robustness, and Usability - these are the main attributes in test automation. 




25. What testing activities you may want to automate in a project? 


Testing tools can be used for : 


* Sanity tests(which is repeated on every build), 


* stress/Load tests(U simulate a large no of users,which is manually impossibele) & 


* Regression tests(which are done after every code change) 




26. How to find that tools work well with your existing system? 


To find this, select the suite of tests which are most important for your application. First run them with automated tool. Next subject the same tests to careful manual testing. If the results are coinciding you can say your testing tool has been performing. 




27. How will you test the field that generates auto numbers of AUT when we click the button 'NEW" in the application? 


We can create a textfile in a certain location, and update the auto generated value each time we run the test and compare the currently generated value with the previous one will be one solution. 




28. How will you evaluate the fields in the application under test using automation tool? 


We can use Verification points(rational Robot) to validate the fields .Ex.Using objectdata,objectdata properties VP we can validate fields. 




29. Can we perform the test of single application at the same time using different tools on the same machine? 


No. The Testing Tools will be in the ambiguity to determine which browser is opened by which tool. 




30. Diffenece between Web aplication Testing and Client Server Testing. State the different types for Web apllication Testing and Client Server Testing types? 


which winrunner 7.2 versioncompatiable with internet explorer, firefox,n.n 




31. What is 'configuration management'? 


Configuration management is a process to control and document any changes made during the life of a project. Revision control, Change Control, and Release Control are important aspects of Configuration Management. 




32. How to test the Web applications? 


The basic differnce in webtesting is here we have to test for URL's coverage and links coverage. Using WinRunner we can conduct webtesting. But we have to make sure that Webtest option is selected in "Add in Manager". Using WR we cannot test XML objects. 




33. what are the problems encountered during the testing the application compatibility on different browsers and on different operating systems 


Font issues,alignment issues 




34. how exactly the testing the application compatibility on different browsers and on different operating systems is done 


Please Send Your Suggetion 




35. How testing is proceeded when SRS or any other docccument is not given? 


If SRS is not there we can perfom Exploratory testing. In Exporatory testing the basic moduole is executed and depending on its results, the next plan is executed. 




36. How do we test for severe memory leakages ? 


By using Endurance Testing . 


Endurance Testing means checking for memory leaks or other problems that may occur with prolonged execution. 




37. what is the difference between quality assurance and testing? 


Quality assurance involves the entire software development process and testing involves operation of a system or application to evaluate the results under certain conditions. QA is oriented to prevention and Testing is oriented to detection. 




38. why does software have bugs? 


1) miscommunication 


2) programming errors 


3) time pressures. 


4) changing requirements 


5) software complexity 




39. how do u do usability testing,security testing,installation testing,ADHOC,safety and smoke testing? 


(이런 질문에 모범 답안은 없습니다. 각자가 어떻게 해왔는지에 대한 경험의 차이겠지요. 테스트해 온 제품에 따라, 어떤 테스트를 어떻게 적용하느냐가 늘 문제로 이슈될 것입니다.)




40. What is memory leaks and buffer overflows? 


Memory leaks means incomplete deallocation - are bugs that happen very often. Buffer overflow means data sent as input to the server that overflows the boundaries of the input area, thus causing the server to misbehave. Buffer overflows can be used. 




41. what are the major differences between stress testing,load testing,Volume testing? 


Stress testing means increasing the load ,and cheking the performance at each level. Load testing means at a time giving more load by the expectation and cheking the performance at that leval. Volume testing means first we have to apply initial.  

1 2 3
블로그 이미지

zzikjh