Skip to content

Commit b2b45ac

Browse files
Wontae ChoiWontae Choi
Wontae Choi
authored and
Wontae Choi
committed
improved readme
1 parent 87e762b commit b2b45ac

File tree

2 files changed

+43
-29
lines changed

2 files changed

+43
-29
lines changed

README.md

+40-29
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,31 @@ learn a model of the target app during testing, uses the learned model to genera
55
unexplored states of the app, and uses the execution of the app on the generated inputs to refine
66
the model.
77

8-
The main purpose of the repository is to provide working demo of the version of the
9-
*SwiftHand* tool submited to OOPSLA'13 conference.
10-
The repository provides ready-instrumented benchmakrs and back-end(testing engine) binary.
11-
Also source code for both front-end (instrumentation) and back-end is available.
8+
The main purpose of the repository is to provide a working demo of the version of the
9+
*SwiftHand* tool submited to the OOPSLA'13 conference.
10+
The repository provides source code for both front-end (instrumentation) and back-end (test engine).
11+
Example applications to paly with are also included.
1212

13+
The document is assuming that your system is either Linux or OSX.
14+
If you are Windows user, we recommend to use a free virtuallization tool
15+
such as VirtualBox and Docker.
1316

14-
INSTALLATION
17+
Installation
1518
============
1619

1720
#### Step 1. Install Android Development Kit (ADK)
1821

1922
Before playing with SwiftHand, please make sure to install the Android SDK (ADK).
2023
You can download it from http://developer.android.com/sdk/index.html.
21-
We recommend to use ADK then 4.1.2 or higher.
24+
We recommend to use ADK 4.1.2 or a higher version.
2225
After installing ADK, please make sure that you have following six files.
2326

24-
- ADK_ROOT/platform-tools/adb
25-
- ADK_ROOT/tools/lib/ddms.jar
26-
- ADK_ROOT/tools/lib/ddmlib.jar
27-
- ADK_ROOT/tools/lib/chimpchat.jar
28-
- ADK_ROOT/tools/lib/guava-17.0.jar (version may vary)
29-
- ADK_ROOT/build-tools/21.0.3/lib/dx.jar (version may vary)
27+
- <ADK_ROOT>/platform-tools/adb
28+
- <ADK_ROOT>/tools/lib/ddms.jar
29+
- <ADK_ROOT>/tools/lib/ddmlib.jar
30+
- <ADK_ROOT>/tools/lib/chimpchat.jar
31+
- <ADK_ROOT>/tools/lib/guava-17.0.jar (version may vary)
32+
- <ADK_ROOT>/build-tools/21.0.3/lib/dx.jar (version may vary)
3033

3134
Please memo your guava.jar version (17.0 in the example), your build-tools version (21.0.3 in the example),
3235
and the path to the ADK root directory. We will need this information later.
@@ -43,13 +46,16 @@ Any recent version of Maven 3 will work.
4346

4447

4548
#### Step 4. Clone the SwiftHand repository.
46-
Now, it is a time to start the real job.
49+
Clone the SwiftHand repository to your local disk. Following command will do the work.
50+
51+
```
52+
git clone [email protected]:wtchoi/SwiftHand.git
53+
```
4754

4855

4956
#### Step 5. Editing the build script.
5057
Open *build.sh.skeleton*, a skeleton of the main build script.
5158
You will find out following four commented lines.
52-
Assign an appropriate values to variable and uncomment it.
5359

5460
```
5561
#export ADK_ROOT=""
@@ -58,20 +64,23 @@ Assign an appropriate values to variable and uncomment it.
5864
#export DX_VERSION=""
5965
```
6066

61-
Once the editing is done, typing the following commands:
67+
Assign appropriate values to the variables and uncomment them.
68+
Once the editing is done, type the following commands:
69+
6270
```
6371
cp build.sh.skeleton build.sh
6472
chmod 700 build.sh
6573
```
6674

6775
#### Step 6. Build.
6876

69-
Now is the time to do the actual build!
77+
Now, it is the time to do the actual build.
78+
7079
```
7180
./build.sh
7281
```
7382

74-
If the build process was succesful,
83+
If the build process is succesful,
7584
you will see two new files in the directory:
7685
*inst.sh* and *test.sh*. Voila!
7786

@@ -80,14 +89,14 @@ Using the Back-End
8089
====================
8190

8291
#### Step 1. Create an Emulator
83-
Do following steps to create Android Vritual Device. The steps will create emulator image.
92+
Do following steps to create Android Vritual Device. The steps will create an emulator image.
8493

85-
1. Luanch SDK Manager (ADK_ROOT/tools/android)
94+
1. Luanch SDK Manager (<ADK_ROOT>/tools/android)
8695
2. Select 'Tools' -> 'Manage AVDs'
8796
3. Push 'New' button to create emulator.
88-
To reproduce the experimental result in the paper, We recommand to use 'Galaxy S' as a device, 'API Level 16' as a target, 'ARM' as a CPU/API. This step creates Android Virtual Device (AVD) image.
97+
To reproduce the experimental result in the paper, We recommand to use 'Nexus S' as a device, 'API Level 16' as a target, 'ARM' as a CPU/API. This step creates Android Virtual Device (AVD) image.
8998

90-
You can find the official guideline about emulator management:
99+
You can find the official guideline about the emulator management from here:
91100
'http://developer.android.com/tools/devices/managing-avds.html'.
92101

93102

@@ -96,18 +105,18 @@ We recommand following command to setup necessary environment variable:
96105
```
97106
<ADK_ROOT>/tools/emulator -avd <AVD_NAME> -wipe-data -dns-server 127.0.0.1
98107
```
99-
-wipe-data options it to start emulator from the factory-reset state -dns-server 127.0.0.1 option is a trick to disabling internet access. <AVD_NAME> refer the name of AVD created by step 2.
108+
-wipe-data options it to start an emulator from the factory-reset state -dns-server 127.0.0.1 option is a trick to disabling internet access. <AVD_NAME> refer the name of AVD created by step 2.
100109

101110

102111
#### Step 3. Execute the Back-End
103112
The tool can be executed using the test.sh script generaated by the build scipt.
104-
For example, to test mininote using SwiftHand with random seed 0 for 1 hour:
113+
For example, to test *dist/benchmark/mininote.modified.apk* using SwiftHand with random seed 0 for 1 hour:
105114
```
106115
./test.sh dist/benchmark/mininote.modified.apk swift 3600 0 <OUTPUT_DIR>
107116
```
108117

109-
Please replace <OUTPUT_DIR> to the output directory you want.
110-
You can try any programs in the benchmark directory by replacing 'mininote.modified.apk' to an appropriate value.
118+
Please replace <OUTPUT_DIR> to the output directory you want.
119+
You can try any program in the benchmark directory by replacing 'mininote.modified.apk' to an appropriate value.
111120

112121

113122

@@ -121,14 +130,16 @@ With a compiled front-end, you can instrument an apk file using the inst.sh scri
121130
./inst.sh <TARGET.apk>
122131
```
123132

124-
Please make sure to replace <TARGET.apk> with the path of the target apk file. You can find two example target files located in *dist/unmofidied* directory.
133+
Please make sure to replace <TARGET.apk> with the path to the target apk file. You can find two example target files located in *dist/unmofidied* directory.
125134
If the instrumentation process success, the front-end generates several files including the following two files,
126-
in the direcory containing the source apk file.
135+
in the direcory containing the original apk file.
127136

128137
- TARGET.modified.apk
129-
- TARGET.json
138+
- TARGET.modified.json
130139

131-
If you have these two files, you are ready to play with the back-end. Please make sure to have these two files in the same directory.
140+
*TARGET.modified.apk* is an instrumented application file.
141+
*TARGET.modified.json* is a text file containing an information about the target application.
142+
To run a test, the back end requires both files to be in a singles directory.
132143

133144
Acknowledgements
134145
================

build.sh.skeleton

+3
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,7 @@ echo "set -x" >> $TS
5353
echo "export ADK_ROOT=$ADK_ROOT" >> $TS
5454
echo "export JAVA_HOME=$JAVA_HOME" >> $TS
5555
echo "java -jar $SWIFT_ROOT/$BACK_END_PATH \${*:1}" >> $TS
56+
echo "if ((\$? > 0));then" >>$TS
57+
echo " cat USAGE" >> $TS
58+
echo "fi" >> $TS
5659
chmod 700 $TS

0 commit comments

Comments
 (0)