Mumbling

Ongoing:

Reverse Engineering of Program (Android, All)

Androguard      ApkInspector    DroidBox   Smali

Todo:

Github Page (tutorial1, tutorial2, tutorial3 Jekyll Tutorial)

Weka (IBM tutorial, Convert CSV to ARFF, )

Program Analysis and Verification

Reading List:

Infer identity from Android public resource
App Recommendations with Security and Privacy Awareness

Interesting topics:

The Architecture of Open Source Applications

Lisp and Clojure

source.android.com

Mayloon

Mobile app state

Web & Mobile Group on W3C

Cucumber and its android tool

OpenIntents (List of intents)

Android security applications

Adsense

CSCOPE; Source_insight

Maven: The Complete Reference; Maven by Example

How to Think Like a Computer Scientist(python)

Koans series(mavenrubyjavascript)

Android Developer Challenge

Git online learning

Architecture of salable website

Interdroid(Android distributed app platform)

0xbench(Android system benchmark)

aster(Android System automated testing)

Android Library & Resources

David Brumley

App Inventor(Education Tool)

ESC/Java2(Java Static Analysis)

The Checker Framework

DENIM and SILK

Go mobile

CSC183-Startup

Google Venture Library

PLEnthusiast

secure se(Android benckmark and tools)

Javassist (Java bytecode engineering toolkit)

Repo

Past:

UI Automator Test Framework

GitHub Archive

GitHub Global Search

Android Market API

AppAware API

Improving Layout Performance

Android Performance tips( including benchmark (code)

JankFree

Interesting product and sites:

pledgie

Material:

Conference and Journal 

Mobile Testing Tool

Books

Writing: OWL

ebook: bookFinder; Library Genesis; Library Genesis II

PhD:

How to Read a Paper

It’s okay to quit

Qual(Arch,System)

Programming:

Java regular expression

customized Hadoop inputformat

Casual:

Famous computer failures

 

Logs:

2017/08/04

Website building: https://github.com/gcushen/hugo-academic; https://sourcethemes.com/academic/; http://gohugo.io/

RL applications: https://gym.openai.com/

2017/09/11

https://github.com/ftramer/Steal-ML

https://github.com/srndic/mimicus

http://materials.dagstuhl.de/index.php?semnr=17351

2017/06/22

Regular language (left/right linear, i.e., terminals are always on the left/right side)

Context-free language (free form)

2017/06/02

Android work profile: https://developers.google.com/android/work/overview

Android instant apps: https://developer.android.com/topic/instant-apps/overview.html

2017/06/01

Draw ROC curve: http://www.rad.jhmi.edu/jeng/javarad/roc/JROCFITi.html

2017/05/22

Deep Learning at Oxford

Neural Network course with math bakground

Learning from Data

Course teaching tensorflow

Books:

http://neuralnetworksanddeeplearning.com/

http://www.deeplearningbook.org/

Misc:

BERKSHIRE HATHAWAY INC. SHAREHOLDER LETTERS

2017/05/15

AFL-GCJ: http://lcamtuf.coredump.cx/afl/ (Does not support Java version higher than 1.7)

2016/09/23

Many malware now can no longer executed:

Reason1: java.net.UnknownHostException: Unable to resolve host “depot.bulks.jp”: No address associated with hostname

 

2016/08/22

sha256sum fileName

2016/06/15

Dump AST: `swiftc -dump-ast` or `swiftc -dump-parse`

2016/06/09

Spectacle: https://www.spectacleapp.com/

2016/05/31

PMD (built in to a zip, then find executable in zip)

FInd code clones in repos:

./run.sh cpd –minimum-tokens 1000 –files ~/Git/mfiosdev/ –language swift –skip-duplicate-files > All_1000

2016/04/29

Experiment command:

find . -name ‘*.jimple’ | xargs wc -l

Malware reports:

Snoopy Android Adware Poses as Power-Saving Patch

‘FakeInstaller’ Leads the Attack on Android Phones

 

2016/02/11

Vim setting: Disable automatic visual mode(:set mouse-=a), paste mode (prevent auto-indention) (:set paste, :set nopaste)

2015/10/11

Refresh (Actually hit the refresh button) the page to reload “.js” files for updated webpage.

2015/08/20

https://en.wikipedia.org/wiki/SQRL

2015/08/17

Java heap & stack. Object is in general created on the heap (because its scope might not be local; it might be referenced outside the method) Unless escape analysis is certain that your object is local: http://stackoverflow.com/questions/8588152/java-where-do-local-variables-object-references-instance-variables

GC algorithm : Mark and Sweep

2015/08/12

Major reasons why soot cannot resolve some apks:

1. Inability of JDK ZipFile class: https://mailman.cs.mcgill.ca/pipermail/soot-list/2014-September/007319.html

2015/08/06

Need to figure out the location to put Scene.v().forceResolve statement.

I put one when initialize Soot. It seems that it will affect the classloading process. A lot of class will be phantom class.

 

2015/07/20

Smali grammar (Dalvik opcodes: http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html)

2015/06/23

Nissenbaum’s notion of “privacy as contextual integrity” —-Nissenbaum, Helen. Privacy in context: Technology, policy, and the integrity of social life. Stanford University Press, 2009.

 

2015/06/09

Zip dex to apk, should zip inside the directory:

zip -r a.apk ./*

Otherwise the internal structure will break, and static analysis tool may not be able to run.

2015/06/08

ByteCode analyzer: JavaAssist (Example),  ASM, Apache Common BCEL

Searching annotation in a code base: Annotation101

2015/05/26

Motivation: reach a balance between privacy preservation and advertising revenue.

Two types of external libraries has privacy infringing behavior: ads library and analytics library (e.g., flurry)

1. study what are the source of info

2. replace info with pre-trained profile (with different combination)

3. see how the ads react

Goal: which info (or combination of info) is mainly used in tracking?

Task:

1. Soot/Wala analysis on jar files.

2015/05/08

study mobile botnet behavior based on course slides, for example, how many download bot code, how many disable anti-virus, what is the attack process etc.

2015/05/04

If no permission to write to emulator:

http://stackoverflow.com/questions/2083709/android-emulator-sdcard-push-error-read-only-file-system

$./adb shell

$su

mount -o rw,remount rootfs /

chmod 777 /mnt/sdcard

exit

2015/02/05

Presentation: Examine the slides and remove any texts/images that is not involved in your talk.

2015/01/27

Running Appcontext:
1. Mytest
2. Replace “/” with “//” in csv
3. Add maliciousness column
4. Run EntrypointParser

2014/12/02

CS563:

Bitcoin (http://en.wikipedia.org/wiki/Bitcoin; http://nakamotoinstitute.org/bitcoin/)

Software Defined Networking (SDN) (28 (Prefix hijacking ect.; Add more AS to control the path BGP will choose), )

2014/12/01

[Log] Dentist (http://www.grad.illinois.edu/sites/default/files/pdfs/dentalbrochuregradassistants.pdf)

 

2014/10/06

[Log] android.content.res.AssetManager: java.io.InputStream open() is not in Susi’s source list. How to ensure the completeness of sources and sinks?

2014/09/05

[Log] [Weka] To exclude ID in classifying but output it in the result: Choose the FilteredClassifier, with the RemoveType as the filter, and whatever classifier you prefer. Then, open “More options…” in the “Test options” box and enter the index of the identifier attribute into the “Output additional attributes” field. To enable this field, you have to tick the “Output predictions” box first.
http://weka.wikispaces.com/Instance+ID
http://stackoverflow.com/questions/12550032/how-to-ignore-a-feature-while-including-it-as-part-of-feature-set-in-weka-gui

2014/08/23

[Log] [Machine Learning]overfitting:  If we supply too much data into our model creation, the model will actually be created perfectly, but just for that data. Remember: We want to use the model to predict future unknowns; we don’t want the model to perfectly predict values we already know. This is why we create a test set. After we create the model, we check to ensure that the accuracy of the model we built doesn’t decrease with the test set. This ensures that our model will accurately predict future unknown values.

Pruning: like the name implies, involves removing branches of the classification tree. Why would someone want to remove information from the tree? Again, this is due to the concept of overfitting. As the data set grows larger and the number of attributes grows larger, we can create trees that become increasingly complex. Theoretically, there could be a tree with leaves = (rows * attributes). But what good would that do? That won’t help us at all in predicting future unknowns, since it’s perfectly suited only for our existing training data. We want to create a balance. We want our tree to be as simple as possible, with as few nodes and leaves as possible. But we also want it to be as accurate as possible. This is a trade-off

2014/08/21

[Log] Copy all file but one

find src/ -type f -maxdepth 1 ! -name Default.png -exec cp {} dest/  \;

2014/08/20

[Log] Benign app sample(search gmail: APPLICATIONS.tar.gz (weiyang3@illinois.edu) or apps_under_1mb.tar.gz)

)

2014/08/18

[Log][AppContext] the handling of icfg should be in the wjtp phase, otherwise the icfg would be in baf format

2014/08/17

[Log] [AppContext] Traverse algorithm to collect conditionStmt for each entrypoint: create a new class DFSPathQueue that can trace paths during DFS.

2014/08/11

[Log] Line Feed(LF \x0A) and  carriage return (CR \x0D): http://en.wikipedia.org/wiki/Newline

[Log][PL] Relationship between fixed-point theorem and Program Analysis techniques:
See Page 14: http://www.imm.dtu.dk/~hrni/PPA/slides2.pdf
Using fixed-point theorem to prove that the program analysis technique can produce maximum(largest) or least solutions.
Example: lampwww.epfl.ch/teaching/archive/advanced_compiler/2007/resources/slides/act-2007-10-data-flow-analysis_6.pdf

2014/08/09

[Log] [Writing] Define a concept, why you define it this way, what’s the definition, what the term represent.(Personally I feel that a good way is why we need the definition -> definition-> what it represent -> why you define it this way)

2014/08/08
[Log] Java2Html

[Log] [FlowDroid] The elements in JimpleBasedInterproceduralCFG will changed from jimple to baf as the soot phase proceeds.

2014/08/07
[Log][FlowDroid]
CallGraph cg = Scene.v().getCallGraph() get the same result after wjtp phase
[Eclipse] Eclipse workspace in use problem, solution: delete the .lock file in the .metadata directory in your eclipse workspace directory

2014/08/06
[Log][FlowDroid]Three problems:
1. the target “com.android.internal.telephony.PhoneSubInfoProxy” in the callgraph become com.android.internal.telephony.PhoneSubInfoProxy$stub when iterate through the body of the src method of “com.android.internal.telephony.PhoneSubInfoProxy”.
Another instance of it is “”. When I go into the body of src, it become “”
2.
3. In callgraph it’s detail method like () , in icfg the method get through icfg.getCallersOf(icfg.getMethodOf(u)) is . To get around I have to use CG with ICFG. Note: I use cgEdge.getSrcUnit to solve the problem, I suspect icfg.getMethodOf(u) may have a bug.

2014/08/05
[Log][soot] instead of using soot.Main.main(args);, We can use PackManager.v().runPacks(); PackManager.v().writeOutput();  to first set all the configuration, then run soot.

2014/08/01

[Log] [Java] Java object’s notify and wait method (Concept of Monitor; Tony Hoare’s paper; Java Synchronized block)

[Log] [AppContext] In side Timer.Schedule method:


schedule(TimerTask task, long delay, long period) 
->  sched(task, System.currentTimeMillis()+delay, -period) (sched(TimerTask task, long time, long period) ) 
-> task.nextExecutionTime = time; 

Timerthread.mainLoop() -> currentTime = System.currentTimeMillis(); 
executionTime = task.nextExecutionTime;  
if (taskFired = (executionTime<=currentTime)) {
    if (task.period == 0) {} 
    else{queue.rescheduleMin( task.period < 0 ? currentTime – task.period : executionTime + task.period)}
}
if (taskFired)  task.run(); // Task fired; run it, holding no locks

noted that it’s = not == in if (taskFired = (executionTime<=currentTime)), the result of the conditional statement is the same as (executionTime<=currentTime) meanwhile the value of (executionTime<=currentTime) is assigned to taskFired

Conclusion: Timer.schedule has conditional statement, and execution of the task is influenced by the System.currentTimeMillis(), long delay, long period; predict if a thread will run repeatedly is hard. We should regard timer.schedule as a separate type of control – frequency or while (true) loop.

 

2014/07/28

[Log] Using soot to get callgraph:

1. Default CG algorithm + Add new SceneTransformer() {…}

2. Spark + runPacks

all with repackaged jar.

2014/07/24

[Log] Fennec(Firefox Mobile): codeBase; IRC;

2014/07/22

[todo] callgraph(queuereader);

2014/07/21

[Log] The meaning of sources and sinks varied depends on the calling context, for example, In the sink <java.io.OutputStream: void write(byte[])>, the OutputStream could be obtained from URLConnection..getOutputStream(), it could also be obtained from OutputStream os = new FileOutputStream(“test.txt”), it could even be java.lang.Process: java.io.OutputStream getOutputStream().

2014/07/14

[Log] Leverage built-in DowloadProvider to Inject the download into content://downloads/download

http://blog.csdn.net/lixinso/article/details/5889159

2014/07/11

[Log] Common Androlyze command:


a, d, dx = AnalyzeAPK("/home/wyang/workspace/CommandLine/samples/DroidDream/26dd1126da55fd0754a0b96d877ac0f36f248e99.apk")

a.show(); show_Permissions(dx);  a.get_permissions()

is_reflection_code(dx); is_native_code(dx); is_dyn_code(dx); show_ReflectionCode(dx);  show_NativeMethods(dx);

z = dx.tainted_variables.get_string("exploid"); z.show_paths(d)

z = dx.tainted_variables.get_field("Lcom/google/android/smart/s;","a","Lcom/google/android/smart/x;")

show_Paths(d, dx.tainted_packages.search_methods(".", "getAssets", "."))

Don’t forget the semicolon “:”

 

2014/07/02

[Log] http://programmers.stackexchange.com/questions/100975/how-to-deal-with-oop-design-problems-in-interviews

2014/06/24

[Log] Delete files before certain date (Using xargs to pipe the result to next command)

 find . -maxdepth 1  -type d -newermt "2014-06-23 22:02:00" | xargs rm -rf

2014/06/18

[Log] Download some of the sources of Malware mentioned here to workspace/git

How to find and install the missing file in Ubuntu:

apt-file search zlib.h

2014/06/17

[Log] The sources and sinks in susi seems redundant. (Even subString() is a sink)

2014/06/06

[Log]

Remove files created at certain time: find . -type d -cmin 179 | xargs rm -rf (http://www.cyberciti.biz/faq/linux-unix-bsd-xargs-construct-argument-lists-utility/)

The difference of SIGTERM and SIGKILL (popen.terminate vs popen.kill on python) : http://major.io/2010/03/18/sigterm-vs-sigkill/

2014/06/05

[Log]pipe one output to multiple inputs with the tee command (http://stackoverflow.com/questions/345505/how-can-you-diff-two-pipelines-in-bash)

ls *.txt | tee /dev/tty txtlist.txt

2014/06/04

[Log] Remember to add break in java’s switch case statement, because:  

All statements after the matching case label are executed in sequence, regardless of the expression of subsequent case labels, until a break statement is encountered. 

2014/5/28

[Log] Difference method used in the sourceSink file and resourceAPI file may lead to problem: for example,

In resource API file, the internet connection is

<java.net.URL: java.net.URLConnection openConnection()>

while in sourceSink file, the sink of internet is

<java.net.URL: void <init>(java.lang.String)>

 

[Log] The sensitivity of (the sources of) the information flows are dependent on the the calling contexts of the information flows.

What are the elements in the calling context that can determine the sensitivity?

In GoldDream, it’s the action and the extra key of the Intent. For each type of sensitive information, we should develop a bunch of signatures that will reflect the extraction/source of the information.

2014/5/27

[Log] Potential improvement on appobaseline:

1. Currently we only use the extra string to figure out the type of information extracted from the source. In future, we can use the intent action type in the if statement and the intent filter of the component to minimize the false positive.

2014/05/20

Epicc: retargeted parameter should point to the “retargeted” subdirectory that dare generates, like this:

-android-directory $outdir/dare/$apk_base/retargeted/*

Python String manipulation

print word[0]          #get one char of the word
print word[0:1]        #get one char of the word (same as above)
print word[0:3]        #get the first three char
print word[:3]         #get the first three char
print word[-3:]        #get the last three char
print word[3:]         #get all but the three first char
print word[:-3]        #get all but the three last character

2014/05/02

[Log] Explicitly make python to call 64-bit java when allocating heap space memory (Post

2014/04/23

[Log] BA automata

manually removing the misses;

binary instrumentation for ARM; PIN; Code generation (instruction count)

2014/04/22

[Log] Handle possible Python exceptions (Especially IO exception), and log down the error instances at the first place; Otherwise the whole script will stop.

invalid syntax in python: usually occurs because of the parenthesis, check the line above to see if any parenthesis missing.

2014/04/21

[Log] Python IO: Open will return a file object:

f = open('workfile', 'w')
for line in open('workfile', 'w') will return a line which is word in sentence plus '\n'; Directly pass line into wn.synsets will cause mistake.

2014/04/20

[Log] Using derby: java org.apache.derby.tools.ij

[log] Python unzip tarball: when using extractall() method of tarfile, using absolute path(os.getcwd()) instead of relative path(. , ..) .

2014/04/15

[Log] Using  facade API edu.cmu.lti.ws4j.WS4J  to calculate similarities.

1. Put the two set as input, output top 10 related words for each permission and their score in each metrics.

2. Use whyper semantic model to do it again.

3. Try it for each API methods.

2014/04/08

[Log] privacy related behavior that is not data transmission:

CAMERASET_ALARM;  MANAGE_ACCOUNTS;

Not for third-party apps (apps with system certification only)

INSTALL_PACKAGES;  MODIFY_PHONE_STATE;

CALL_PHONE;  SEND_SMS;

2014/04/01

[Log]

abortBroadcast will prevent any other broadcast receivers from receiving the broadcast. This design is wired…

If you give the foreign application a PendingIntent you created using your own permission, that application will execute the contained Intent using your application’s permission.

 

2014/03/15

[Log] Classify the events in the system (covey information or receive instructions from users)

(Then enforce policy that what it could do) (leverage which permissions etc.)

 

2014/03/09

[Log] Firing Event from command line:

SYSTEM: adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -c android.intent.category.HOME -n package_name/class_name

Lifecycle: onCreate:

adb shell am start -n package_name/class_name

onStop:

adb shell am kill package_name

2014/03/08

[Log] Example: MoonSms

[Log] Implementation optimization:

1. Use full path name rather than short version in the .dot file.

2. Start soot once for all construction.

3. Add methods other than startActivity in the implementation. (Or use epicc)

4. Solve the bug bin forward

5. Bug: The method list is not complete (f9bb3fc540b5e45ea9346d267455e1487644e1dc.apk)

2014/2/28

[log] fix hard disk error: Chkdsk

2014/2/3

[log]WindowsError: [Error 2] The system cannot find the file specified

This is because I haven’t set the environment variable for Java. Add “C:\Program Files\Java\jdk1.7.0_51\bin” to PATH.

2013/12/5

[Latex] newcommand number parameter

\newcommand*{\temps}[1]{%

\ifnum#1=1 %

temporal condition

\else

temporal conditions

\fi }

[Log] Problem with xml parser when parsing xml files. The charset is org.xmlpull.v1.XmlPullParserException: start tag unexpected character

2013/11/28

[Log] System event: Life cycle methods can be inferred from intent-filter and its name(onResume etc.); Other system event method (mostly inner class(listeners)): LocationListener.onLocationChanged; MediaPlayer.OnCompletionListener.onCompletion; SharedPreferences.OnSharedPreferenceChangeListener.onSharedPreferenceChanged;

Activity: onConfigurationChanged;onLowMemory;

onProvideAssistData;onSearchRequested; onTrimMemory; onActivityResult;

UI events: AppWidgetProvider.onUpdate; AppWidgetProvider.onAppWidgetOptionsChanged; AppWidgetProvider.onEnabled;  AppWidgetProvider.onDisabled; AppWidgetProvider.onDeleted;  Activity.onWindowFocusChanged; Activity.onOptionsItemSelected

2013/11/21

[Log] DroidDream Light using notification bar to advertise large amount of URL. It doesn’t require any permission to get source, nor it require any internet access. Malware and benign application

2013/11/20

[Log] 误差: startService父节点搜索init, setclass, setcomponent…可能搜出的parameter是activity……

2013/11/19

[Log] BaseBridge\396888b036203ee436f860b664aec91f8b40afdc.apk registerReceiver  Intent attack http://home.mcafee.com/VirusInfo/VirusProfile.aspx?key=692606#none

 

2013/11/15

[Log] Discount Usability Testing :involves user testing with low-tech paper mock-ups to get rapid feedback on early design

[TODO] Usability of Mobile Websites

concepts

2013/11/13

[Log] The intent-filter also need permissions. We do know when these permission is being used, but we can’t explain what it used for.

2013/11/3

[Log] Install vmware tool to share folder: http://theholmesoffice.com/how-to-share-folders-between-windows-and-ubuntu-using-vmware-player/; For 12.04: http://www.cnblogs.com/lifegoesonitself/p/3357375.html;

 

2013/10/28

[Log] When found “init” method in call graph, it could be ad library method. But have never been invoked;

2013/10/23

[Log] pig:

grunt> Records = LOAD ‘wikisnapLink/part-00000’

AS (title:chararray, time:int);

A = ORDER Records by time DESC;

B = LIMIT A 10;

DUMP B;

 

2013/10/22

[Log] The DOTALL mode can  make dot match newlines.(Post)

Use Scanner(File source) might produce problem; Use Scanner(Readable source) instead; (Post)

2013/10/07

[Log] Some of the security critical method is invoked by Service or broadcastReceiver, while these Services or BroadcastReceivers are triggered by system intent (inferred from manifest file). So we also need manifest file here to infer the user-perceived events. (Reason that we need information in addition to call graph: we don’t know who invoke service or broadcastReceiver from call graph)

2013/10/06

[Log] 09b143b430e836c513279c0209b7229a4d29a18c.apk -> yoyo Player (Crash on Nexus 7)

53dc08f08005f374a957afa44607ab52f205b684.apk ->Dandelion (Background wallpaper service)

730fed46dc7f13691906f46111ee5e05aa1b854e.apk -> I’go reader

8a15729f0f7fcdb68782fe78429a714225e58610.apk -> camera show

[Latex]

! LaTeX Error: File `listings.sty' not found.

Change type TarBzip2 to TarLzma in [listings] entry

http://tex.stackexchange.com/questions/126514/miktex-fails-to-download-the-listings-package

2013/9/29

[Log]http://bbinto.wordpress.com/2012/09/18/why-bashing-facebooks-html5-hybrid-app-is-mean-and-doesnt-make-sense/

[Log] For those apps throwing “staticness” exception, I use log3 to mark them(including those with non ASCII character), I commented out a line in “SootMethodRefImpl.checkStatic(SootMethod ret)”:

throw new ResolutionFailedException( “Resolved “+this+” to “+ret+” which has wrong static-ness” );

For those apps throwing “ambiguous method” exception, I use log4 to mark them, I commented out a line in “SootClass.getMethodByName(String name)”:

throw new RuntimeException(“ambiguous method: ” + name + ” in class ” + this);

2013/9/28

[Log] The previous script failed to generate all callgraph because the missing platform API. I download all API and add a script to generate missing call graph.

[Log] replace non ASCII character in String

String resultString = subjectString.replaceAll("[^\\x00-\\x7F]", "");

2013/9/27

[LOG] add following code to  SetupApplication.calculateSourcesSinksEntrypoints(Set<AndroidMethod> sourceMethods,Set<AndroidMethod> sinkMethods):

Transform transform = new Transform(“cg.checkCG”, new SceneTransformer() {
protected void internalTransform(String phaseName, @SuppressWarnings(“rawtypes”) Map options) {
// Process the worklist from last time
//added
System.out.print(“entered”);
//CallGraphPrinter.printCG(Scene.v().getCallGraph());
CallGraph cg = Scene.v().getCallGraph();
Set<MethodOrMethodContext> method = CallGraphPrinter.findNode(cg, “LocationManagerrequestLocationUpdates”);//ContextWrappergetContentResolver;MainActivityaddBillAmount
CallGraphPrinter.printSubCG(cg, method);
System.out.println(“exit”);

}
});
PackManager.v().getPack(“cg”).add(transform);
PackManager.v().runPacks();

2013/9/25

[log] Writing: artifact(data, network traffic) cannot represent program behavior; Does model representing the program behavior contain the information of when program has this behavior? Does the representation of such information can be understood by human? User-comprehensible context information is important to identify program features/functions/behaviors.

 

2013/9/17

[log] I comment out “app.calculateSourcesSinksEntrypoints(“SourcesAndSinks.txt”);” to make anroid flow run faster.

2013/9/16

[BIB] The computer scientist as toolsmith II : “intelligence amplifying systems can, at any given level of available systems technology, beat AI systems. That is, a machine and a mind can beat a mind-imitating machine working by itself.”

2013/9/11

[Bib] Helping Users Avoid Bugs in GUI Applications: It shares the same motivation of avoid bug in inter application interaction.

2013/9/8

[log] The activity receive the intent data may not be the one to process it. Example: When The hangout app receive text intent, it will first ask user to choose the person user want to talk to, then pass the text in the intent to conversation activity.

[Bib] Mining behavior model from GUI

2013/9/3

[log] Add print machine: \\engr-print-01 UofI\NetID Detail Instruction

2013/8/25

[bib] A common practice for application developer to write intent-filter is use code search engine to search Intent field key words (for example, search android.intent.action.SEND )

2013/8/24

[bib](Epicc) “We found that the majority of specifications were relatively narrow, most ICC  objects having a single possible type. Also, key/value pairs are widely used to  communicate data over ICC” (extra or extras filed)

2013/8/18

[bib] (Constraint-Based Automatic Test Data Generation) Theory: In a mutation system, the tester’s goal is to create test cases that kill each mutant. Put another way, the tester attempts to select inputs that cause each mutant to fail; Mutation operators are designed to represent common mistakes that a programmer might make. The assumption behind any criteria for generating test data is that the subset of inputs chosen will find a large portion of the faults in the program as well as help the tester establish some confidence in the software (kill all the mutant means exclude common mistake from the software thus building confidence for programmer);  Approach:

2013/8/17

[TODO] Try out Android inter application analysis tool epicc

2013/8/14

[log] HierarchyViewer shows that pure phonegap application only has a webview, it can not detect what’s inside webview.

Tracer for openGL ES will show more detail activity from GPU’s perspective but your application becomes very slow when you enable the feature from tracer to capture screenshot.

2013/8/13

[Ideas] Comparing the model generated by ORBIT to examine the consistency.

[Todo] Group traces based on their data features; Read phonegap source code to know which JS method will trigger related java method.

[log]Start MangoDB: (related post)

C:\mongodb\bin\mongod.exe

[Problem] When and where to use hardware acceleration (like translate3d)? Different platforms have different levels of support for hardware acceleration, and performance can vary. Detail in this post

2013/8/9

[log] search google code project on https://code.google.com/hosting/

[log] google code subjects: aiyou;geolocation markerMHC-appen(Gplay);bankmobilewebehighlingshidaoNumberGuessAdroCVfinesappParty;

github subjects: wikipediahtml5googleauthteamtoy,phonegap-explorer,Freshfood, Wakable, Drupalgap(gplay), tinybobeermedirectory-backbone-topcat, Lil-doodleLegends (blog post), NameTrendz,

other subjects: kitchensink

2013/8/8

[log] adb devices找不到进程时,在任务管理器中中止adb.exe

[log] Use “adb shell input” command when monkeyrunner and robotium not working. See here

[log] code numbers for adb input event (Post)

[log] Use “adb shell am” to control application (start, kill etc) from command line (Question)

2013/8/7

[log] Find current activity name using

adb shell dumpsys activity

or dumpsys window. (See the question here)

[log] Use python script’s full path to run monkeyrunner like:

monkeyrunner D:\Programming\Workspace\Python\monkeyRunner\teamtoyTest.py (See question here)

[log] Use –throttle to slow monkey down.

2013/8/5

[Note] Shell and python subprocess

2013/7/30

[Log] SurfaceFlinger is in charge of putting your pixel on to the screen.

Application thread: deliverInputEvent marks the delivery of touch/input event; Deque (receive buffer from SurfaceFlinger)

[Log] phonegap’s path by npm installation: C:\Users\david\AppData\Roaming\npm

All command-line usage

$ phonegap create my-app
$ cd my-app
$ phonegap run android

2013/7/29

[Log] In systrace, performTraversals blocks will tell you how long the application spent drawing a frame.(cite from this post)

[TODO] Anatomy & Physiology of an Android

2013/7/26

[TODO]Web app(http://developer.android.com/guide/webapps/overview.html) and webview(http://developer.android.com/reference/android/webkit/WebView.html)

2013/7/25

[TODO] https://code.google.com/p/trace-viewer/

[Log] Traceview Both not working on Emulator/Phone, on Linux/Windows. Seems need to rebuild the kernel to solve the problem.

[Log] Unbrick Samsung galaxy s3: http://www.smartphonejam.com/2012/07/How-to-Fix-Unbrick-or-Recover-Bricked-ATT-Galaxy-S3-SGH-I747.html  I brick the phone by accidentally flash a different version kernel(4.0.4) on the phone.

2013/7/24

[Log] When adb can’t find devices, try to use task manager kill adb.exe (or using adb kill-server) and then restart adb by using  adb start-server.

[Log] When you can’t change mod for a file, try not using sudo. if still can’t, copy it to some other directory, chmod, and move it back.

[Log] tadb.exe (a tencent android component) will override the adb command. Use dir tadb.exe /a /s to find all tadb.exe and delete them.

2013/7/23

[Log] Setting a listener(page 27 of the slide) in ViewTreeObserver or set DEBUG_FPS to true in the android framework source will record the frame rate.

[TODO] 1.Go over github apps by stars(auto & manually) 2. Systrace 3.

2013/7/18

[Log] (Bug) Wikipedia:

1. when click the textfield for search, the keyboard won’t popup (after scrolling the screen a little bit, it will)

2.冲2, 故事大纲点击后箭头方向不变(IOS will respond but Android version won’t)(Android version 1.3.4 Gplay 01/22/2013); Overall the expand action is laggy.(On Iphone 4)

 

2013/7/10

[Log] Extract 964 app in Phonegap Android page; Get 885 Valid App ID; 79 Apps reside in other markets(non-googleplay market).

2013/7/9

[Log] Add a capital L to the end of your long number: http://stackoverflow.com/questions/7093186/the-literal-of-int-xxxxx-is-out-of-range

[Log] Separate manual editing and program editing files to prevent override. (Don’t use program to write to the manual editing file, at least make a copy of the file if you have to.)

[Log] using jsoup library to get all App ID address.

[Apache POI] after modifying the workbook, remember to write workbook object to the file:

try {
FileOutputStream fileOut = new FileOutputStream(workbookName);
wb.write(fileOut);
fileOut.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

2013/7/8

[Log] ID excel ->Download Comment -> Comment Document -> Analyse comment -> Organised comment document and Analysed result.

[POI API] Check the component map to see the jar you may miss: http://poi.apache.org/overview.html#components

related question: http://stackoverflow.com/questions/14067983/apache-poi-3-9-workbookfactory-method-not-found

[Java] When search in string, dot should be represented as “\\.”, when write to string, it can be represented as both “.” and  “\\.” (the first argument in String.replaceAll() is a regular expression, not a literal string.)

2013/7/1

[Log] Pre-processing steps: 1. \t -> space; \’ ->’ ;  \” ->”; – -> space;

Analyse criteria:  percentage of performance comments in all/in each level/

2013/6/12

[Writing] Comment for reading JavaMicroBenchmark in caliper: Compilation(or JIT compilation) should know how to optimize the code; The things that developer need to do is to make structural changes: Move the redundant calculation out of loops; Decide which part written in web code and which part in native code.

[Idea] Study the practice of intent and its content resides in URI; and the handling of the intent. To see whether the two concur.

[Idea] Identify which CSS element slow down the performance of the whole page. According to IO12 video “Jank Busters”.; And the way to exercise different actions (like scrolling)

2013/6/10

[Idea] Why design, cannot be carried out in a test driven fashion, just like development does?

2013/6/9

[Idea] Detecting UI constrains; If the UI appears too early(before all the resources loaded or prepared) or disappear too late(after the action has already been fired; Use might feel impatient and fire the same action same and same again; probably due to performance issue so that UI hangs), the user action on these UI may crash the application.

2013/6/5

[TODO] 1. Dig the technical detail of bridging web code and native code? 2. What are the hardware acceleration of current devices? 3. Search the hybrid apps on other levels(wrappers, native UIs) (maybe using keywords “html” “mobile” etc.)

2013/6/4

[bib] By studying user’s perception to animation and video, the study(The Impact of Cognitive Styles on Perceptual Distributed Multimedia Quality) suggests that the two QoS(Quality of Service) parameters do not impact user QoP(Quality of Perception), multimedia content and dynamism levels significantly influence the user understanding and enjoyment component of QoP

[TODO] 1. There are many existing techniques to improve the performance of HTML5.  But that also applies to web application. Is there any performance bottleneck unique to hybrid apps?

2013/6/3

[TODO] 1. Why HTML5 is so different from last 4 versions? 2. Why interpreted code would be slower than compiled code? 3. What make UIWebViews are simply not robust enough to handle the needs presented in a rich application like Facebook? 4. How to improve the performance of HTML5?

2013/5/31

[TODO] 1. Best practice of phonegap app (Or web app on Google IO), 2. Try open source and library app. 3. Scrape Google Play comment.(Analysis of user comments: an approach for software requirements evolution. ICSE13′)

2013/5/29

[Android]

Using traceview:

  • Lunch your app from eclipse in debugging mode.
  • Go to DDMS View
  • In devices window there is a small button called Start Method Profiling
  • Click it when you want ( you can combine it with break points to get accurate start/end)
  • when you’re done click Stop Method Profiling
  • A new window in DDMS will appear similer to traceview with the same output.

Performance Case Study

Vsync

2013/5/16

[Linux] Search command history:  shortcut of bash “Ctrl + R“, it can “search through previously used commands”

2013/5/15

[Linux] Add path to linux: in directory /etc type: sudo vim profile; and then source profile; (source can enable the setting in command line temporarily; Restart to make profile effective)

[Linux] type “printenv” to get the environment variables (http://stackoverflow.com/questions/5736641/ant-unable-to-find-javac-java-home-wont-set-on-ubuntu)

[PhoneGap]

./create /home/wyang/Projects/FirstPhoneGapProject com.youngwei.PhoneGapProject1 FirstPhoneGapProject

Don’t use “-” in project name or package ID http://community.phonegap.com/nitobi/topics/error_creating_android_project

[PhoneGap]

How to import the code of an existing open source project (using phonegap build) into a project that can use command build:

1. First create a new PhoneGap application. And override the assets/www directory with existing code:

$ /path/to/cordova-android/bin/ ./create /path/to/my_new_cordova_project com.example.cordova_project_name CordovaProjectName

2.  Build( For Debug):

/path/to/my_new_cordova_project/cordova/ ./build --debug

3. Run

/path/to/my_new_cordova_project/cordova/ ./run [Target] [Build]

where [Target] [Build] are optional parameters.

  • Target specification. This includes --emulator--device, or --target=<targetID>.
  • Build specification. This includes --debug--release, or --nobuild.

2013/5/14

[Idea] Summarize the feature of each phone and create API mapping for equivalent functionality.

2013/4/10

[Idea] The location of the code statement triggering collateral failure in the whole program structure will provide information for the fix.

[Idea] As described in this post, it’s very hard to automatically (or even manually) know the source of Intent to set up different data android:scheme.How to infer such information?

[Idea] Collateral failure is the simplest to detect. The work of finding oracle to help propagate other faults is essential.

2013/3/31

[Latex] Remove binary files(.aux, .gz files etc.) from last built if you find wired compilation. errors. And then recompile. Something might be wrong in .bib file if you can compile the tex file before compiling bib file, but throw compilation error after compiling bib file.

[Idea] Testing HCI rather than GUI. Challenges/Tasks: 1. Modeling interaction; 2. Generate test cases.

2013/3/13

[Idea]

Usability evaluation: task completion steps;Number of touches; Total navigation distance.

2013/2/28

[Git]

Initialize repository: git remote add [alias] [url]

Check the changes before commit: git status

Switch to a branch: git checkout [branch]

Merge a branch into current one: git merge [branch]

Final push:git push (-u) [alias] [branch]

2013/2/21

[Idea]

sharing data between applications results in an unexpected loss of control of that data; Many research have been focused on the security part; But the security as a whole is about the unexpected functionality. We will carry out the study about whether intent and intent-filter pair would be sufficient to advertise or constrain the functionality.

2013/2/18

[Reading]{

A sequence is like a bit of genetic code. It helps things to unfold in the right way. An human embryo follows steps as it grows, and if it misses a step then there is a malformation. But ten embryos following the same sequence well leads to ten very different people, each one unique.

A sequence means a different process.

Normally what happens when you build a house, for example, is that an architect, tries more or less or understand what you want and makes a blueprint. But a blueprint and CAD designs are mostly guess work about what is going to be just right for the dimension of a room or the placement of a window. It’s like tossing thirty coins all at once and hoping they all land on heads. Never works. A sequence is figuring out which decision has to come first and getting it right and then moving to a second decision. Like tossing one coin at a time, which is actually a much better, faster, and less expensive way to get to thirty coins all on heads. But if you work from a blueprint you are stuck with your guesses and the builders, who aren’t the architect, just have to follow the blueprint, even when they know a much better solution. It’s a silly way to do things.

(My comment) Formal writing is more like blue print. Before we figure out the outline of a research project(Problem, technical challenges), we need to understand the sequence of things we should do on this project.

(Recurring iteration like Finding problem-> possible solution -> applied to more problems -> prune the solution)

( How developer develop inter-application communication -> What’s the common bugs -> How to detect those bugs -> How to fix those bugs -> How to prevent those bugs )

}

[Programming] A serialization bug. The package name and classname must be exactly the same at the both sides(Serialization and deserialization). Related post.

2013/2/11

[Idea] We can use intent flag to assist the crawling and navigating.

2013/2/7

[Idea]

  • Study the cooperation of the apps execution. How do I know an app will cooperate well with my own app? As “Activity A’s request (as defined in the intent) is honored over Activity B’s request (as defined in its manifest)”, the activity B will run in a different behavior than developer expected.
  •  test for navigation behaviors that might conflict with the user’s/developer’s expected behavior

[Idea] Study the responsiveness of Android application(How the life cycle(Intent flag) should be arranged to improve the responsiveness; How to keep the resource consumption of the background application to the minimum.)

[Android]If Activity A starts Activity B, Activity B can define in its manifest how it should associate with the current task (if at all) and Activity A can also request how Activity B should associate with current task. If both activities define how Activity B should associate with a task, then Activity A’s request (as defined in the intent) is honored over Activity B’s request (as defined in its manifest). So comparing the model that app running itself as the model when the app invoked by others is meaningless. Intent flag is an important factor that affect the application’s GUI model.

[Writing] {Definitions:

A task is a collection of activities that users interact with when performing a certain job. The activities are arranged in a stack (the “back stack”), in the order in which each activity is opened.

Filters advertise the capabilities of a component and delimit the intents it can handle

Activities in the stack are never rearranged, only pushed and popped from the stack—pushed onto the stack when started by the current activity and popped off when the user leaves it using the Back button. As such, the back stack operates as a “last in, first out” object structure.

A task is a cohesive unit that can move to the “background” when users begin a new task or go to the Home screen, via theHome button. While in the background, all the activities in the task are stopped, but the back stack for the task remains intact

One activity in your application might be instantiated multiple times (even from different tasks)

}

[Idea]{Can GUI model represent Precondition, postcondition, and abstract invariant checks? Correlation among AUT’s solo model, interactive model and Oracle app’s solo model, interactive model?

Filters advertise the capabilities of a component; Partially describe the Precondition

Flags can be the invariant of GUI model.

Model invariant: The activity state should remain the same when move from foreground to background and then move back.

Application specific invariant: Activity management(If the application sequence is A ->B ->C -> A; Questions on stackoverflow like that: 12,3; “The most common errors/bugs in Android apps” from Quora);

}

[Idea]How to derive model based specification from task specification (StartActivityForResult(); OnActivity(); etc.)

 

2013/2/5

[Android]Candidate AUT: Davike Explorer; Network Log; aLogcat(boundary); Call Meter 3G(boundary)

[Idea] Activity life cycle and thread life. Related post.

[Idea]Task driven UI testing. Post

2013/2/4

[Android]PackageManager can help generate an intent to invoke another application(getLaunchIntentForPackage); But this method can only invoke the app as the app start itself, if we need to pass some parameter, we may still need implicit intent;

We can also use PackageManager to verify if the intent will be resolved on this phone(queryIntentActivities);

An intent can be use to turn applications into high-level libraries and make code re-use something even better than before.

,requestCode的作用是一个区别数据来源的标示符。比如A可以启动B, C, D三个Activity并期望从这三者得到数据,那么在用startActivityForResult()启动他们时,为他们分别分配一个独一无二的requestCode,然后在onActivityResult()方法中处理返回的数据时,就可以根据requestCode判断数据来源于B, C, D中的哪一个,进而进行不同的处理。

2013/1/31

[Linux] Java directory for Ubuntu: /usr/lib/jvm

Set JavaHome: Need to verify this post

[Android] Resign the APK so that you can test it. (Android document about AppSigning; A tool; Robotium Document)

Import existing Android project code to Eclipse is troublesome. (If you don’t have build.xml and build.properties like Davik-Explorer)

OlD LOG

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

How background application works? Syncing(For the sake of lesser data usag), loading etc…

Traditional Java library applied on Android Platform…

Platform migration and testing technique.

Multiple platform testing.

Using more resource on UI processing, which will save waiting time of the users. But how do you find this balance? Is there any best practice here?

Close unnecessary background process automatically.

如何模拟情景输入,比如手势等;

检测误操作是否有被二次检测dominate;误删文件之类(GUI)

Works fine on Emulator, but have error on real machine

 

Apps need multiple device interaction.

 

reproduce bug based on bug report.(其因为手机的多样性,系统的开放性导致bug很难repro,bug找之不尽)

 

The main difference from java program is that in integration testing. The integrate method—communication approach is different.

 

Testing: The controllability of Android program(provide the program with needed input) is poor.

 

May. 24th

Emma: http://emma.sourceforge.net/reference_single/reference.html

Use “java -cp emma.jar emma report -r html -in coverage.em,coverage.ec -sp src/” to generate coverage report

 

The “adb pull” has different local location when used on command line or on mobile shell(adb shell).

 

遇到这个问题Error = Unable to find instrumentation info for……..可试试

adb shell pm list instrumentation 查看你的设备有没有安装这个instrumentation测试包,使用adb shell am instrument -w 必须要在设备上安装测试包

 

May. 25th

Main for astrid: com.todoroo.astrid.activity.TaskListActivity

 

 

    • getting the coverage report could not be any simpler:
      • create the ant script for building the test project. Open command prompt and go to your test project directory:
  • android update test-project -m <your_main_project_full_path> -p .
    • and run
  • ant coverage

 

 

More complete version should be:

 

 

In this example I expect that your test project is in a folder “tests” in your project folder which gets tested.

  1. Create a build.xml for your project (if it does not yet exist) cd <main project folder> android update project --path .
  2. Create the build.xml for the test project (that will allow us to do the coverage) android update test-project -m <full path to main project> -p tests/

Somehow “.” does not work and you have to use the full path like “/home/pboos/develop/workspace/project”

  1. Run coverage cd tests/ ant coverage

 

 

somehow, i always got error:

 

[exec] Failure in testRepeatingTaskUpgrade:

[exec] junit.framework.AssertionFailedError: expected:<2> but was:<0>

[exec] at com.todoroo.astrid.upgrade.Astrid2To3UpgradeTests.testRepeatingTaskUpgrade(Astrid2To3UpgradeTests.java:220)

[exec] at java.lang.reflect.Method.invokeNative(Native Method)

[exec] at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)

[exec] at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)

[exec] at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:537)

[exec] at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1551)

[exec]

[exec] Error: Failed to generate emma coverage. Is emma jar on classpath?

[echo] Downloading coverage file into project directory…

[exec] remote object ‘/data/data/com.timsu.astrid/coverage.ec’ does not exist

 

BUILD FAILED

/home/wyang/astrid/tests/build.xml:92: exec returned: 1

Not valid even after emma.jar in classpath(eclipse or $CLASSPATH). WILL try on my laptop again.

 

 

 

ant -diagnostics | grep home
To check the ANT_HOME

 

 

I comment the testRepeatingTaskUpgrade() test case in Astrid2To3UpgradeTests. in the package com.todoroo.astrid.upgrade.

 

 

May 30th.

Commandline error:

 

Buildfile: /home/david/workspace/astrid-tests/build.xml

 

coverage:

[echo] Running tests …

[exec]

[exec] com.todoroo.andlib.service.DependencyInjectionTests:…….

[exec] com.todoroo.andlib.sql.QueryTemplateHelperTest:………..

[exec] com.todoroo.andlib.test.SimpleAndroidTest:..

[exec] com.todoroo.andlib.test.TodorooTestCase:.

[exec] com.todoroo.andlib.utility.DateUtilitiesTest:….

[exec] com.todoroo.andlib.utility.TitleParserTest:………………….

[exec] com.todoroo.astrid.backup.BackupServiceTests:….

[exec] com.todoroo.astrid.dao.MetadataDaoTests:….

[exec] com.todoroo.astrid.dao.TaskDaoTests:……

[exec] com.todoroo.astrid.gtasks.GtasksDetailExposerTest:……

[exec] com.todoroo.astrid.gtasks.GtasksIndentActionTest:………..

[exec] com.todoroo.astrid.gtasks.GtasksMetadataServiceTest:………

[exec] com.todoroo.astrid.gtasks.GtasksTaskListUpdaterTest:……

[exec] com.todoroo.astrid.gtasks.GtasksTaskMovingTest:…………

[exec] com.todoroo.astrid.model.TaskTests:..

[exec] com.todoroo.astrid.provider.Astrid3ProviderTests:…….

[exec] com.todoroo.astrid.provider.ProviderTestUtilities:.

[exec] com.todoroo.astrid.reminders.NotificationTests:…..

[exec] com.todoroo.astrid.reminders.ReminderServiceTests:…….

[exec] com.todoroo.astrid.repeats.AdvancedRepeatTests:………

[exec] com.todoroo.astrid.repeats.NewRepeatTests:…………………………

[exec] com.todoroo.astrid.repeats.RepeatAfterCompleteTests:….

[exec] com.todoroo.astrid.service.ABTestingServiceTest:…….

[exec] com.todoroo.astrid.service.AstridDependencyInjectorTests:…

[exec] com.todoroo.astrid.service.QuickAddMarkupTest:…..

[exec] com.todoroo.astrid.service.UpdateMessageServiceTest:………..

[exec] com.todoroo.astrid.subtasks.SubtasksMovingTest:…..

[exec] com.todoroo.astrid.test.AstridTranslationTests:……

[exec] com.todoroo.astrid.test.DatabaseTestCase:.

[exec] com.todoroo.astrid.upgrade.Astrid2To3UpgradeTests:.

[exec] Error: Failed to generate emma coverage. Is emma jar on classpath?

[echo] Downloading coverage file into project directory…

[exec] remote object ‘/data/data/com.timsu.astrid/coverage.ec’ does not exist

 

BUILD FAILED

/home/david/workspace/astrid-tests/build.xml:92: exec returned: 1

 

Total time: 4 minutes 17 seconds

 

May 31st

grep   string   /home/location   -r
finally get coverage by email replied on github:

cd astrid

ant all clean

cd ../tests

ant clean emma debug install coverage
adb shell monkey -p com.timsu.astrid -v 500

To see the package name:

1. lauched the application, see the logcat, take the part before “/” as the packagename;

2. Menu > Settings > Applications > Running

 

The emulator preserves the application and its state data across restarts, in a user-data disk partition. To ensure that the application runs properly as you update it, you may need to delete the emulator’s user-data partition. To do so, start the emulator with the -wipe-data option.

 

 

June 4th

 

Robotium is better compared to Monkey runner, cos Monkey runner needs objects based on location(x,y co-ordinates which may change as the application evolves) whereas Robotium  uses attributes of the object such as Text, index, image etc.
CaLABASH:http://blog.lesspainful.com/2012/03/07/Calabash/

 

June 5th

adb shell am instrument -e coverage true -w

 

June 6th

 

./adr-ripper.sh -cp . -c net.mandaria.tippytipper.activities.TippyTipper -pt 10737 -g ./Demo/Demo.GUI -l ./Demo/Demo.log

new window(s) opened!!!

June 8th

use static analysis to provide more information:

onCreateOptionsMenu means there will be action triggered by MENU key.

 

Even the ID will be duplicate, we can still apply program analysis to see which onclickListener will be set in the application.

 

 

June 11th

 

Solve the problem of having space in path in shell script.

x=”test me”

eval cd $x

A combination of in a double-quoted text constant and an “eval” before “cd” makes it work like a charm!

 

More reference on eval: http://hi.baidu.com/zjunmm/blog/item/6fb1770a904f53bd2eddd48a.html

 

 

June 12th

track setConentView and inflate to construct the widget hierarchy(Integration tree).

Information about Inflate: http://android.tgbus.com/Android/tutorial/201104/348009.shtml

 

June 14th

Some action like fling is constomized: http://stackoverflow.com/questions/937313/android-basic-gesture-detection

This situation is for

 

June 18th

Resource usage in the code Resource r = gerResources();

 

June 21st

 

jar cvf bundle.jar *

 

add all the files in a particular directory to an archive (overwriting contents if the archive already exists). Enumerating verbosely (with the “v” option)

 

To check the entry names in the jarfile, use the “t” option:

% jar tf bundle.jar

 

June 22nd

Linux系统最初就是不需要图形界面的,因为有一个很强大的文字界面。按 Ctrl-Alt-F1(F1-F6 一般来说都可以),然后等一会儿,就会切换到 tty,也就是所谓的文字界面。这个时候需要用用户名密码登入。注意,可能键盘输入的速度比较慢,不过应该还是可以忍受的。下面在提示符后面输入 top 回车,这时会看到一张动态的表,上面列出了耗用资源最多的进程。观察它刷新一两次,按q退出,然后输入 kill ,其中的 PID 你可以在 top 里面看到。这个时候应该会快了不少,如果你发现没有成功结束掉,就再输入 kill -KILL ,这次基本上就没问题了
Monkey may provide some basic functions to carry out actions like fling:

http://bloodysofiya.blog.163.com/blog/static/116562343200911305442272/

 

June 28th

Java 传参

 

1.对象就是传引用

2.原始类型就是传值

3.String类型因为没有提供自身修改的函数,每次操作都是新生成一个String对象,所以要特殊对待。可以认为是传值。

 

O’Reilly’s Java in a Nutshell by David Flanagan (see Resources) puts it best: “Java manipulates objects ‘by reference,’ but it passes object references to methods ‘by value.'”

 

有人已经总结过:

参见

1、对象是按引用传递的
2、Java 应用程序有且仅有的一种参数传递机制,即按值传递
3、按值传递意味着当将一个参数传递给一个函数时,函数接收的是原始值的一个副本
4、按引用传递意味着当将一个参数传递给一个函数时,函数接收的是原始值的内存地址,而不是值的副本

 

Junly 2nd

The equals() method of List,  returns true if and only if this list contains at least one element e such that (o==null ? e==null : o.equals(e)).

July 9th

Java objects live on the heap, not the stack, and they are *never*

implicitly copied (except when they are serialized and sent over a network).

http://www.velocityreviews.com/forums/t130354-arraylist-behavior.html

 

tringBuffer’s equals method returns true only when a StringBuffer

object is compared with itself. It returns false when compared with any

other StringBuffer, even if the two contain the same characters.

To compare the String objects that are produced by the StringBuffer

objects in their current state, use s1.toString().equals(s2.toString())

instead.

July 19th

PriorityQueue

The head of this queue is the least element with respect to the specified ordering.

Comparator compare(T o1, T o2)

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
July 23rd

除了在函数传值的时候是”引用传递”,在任何用”=”向对象变量赋值的时候都是”引用传递”

How to enable computer keyboard through emulator:

http://android.stackexchange.com/questions/23333/how-can-i-use-my-pcs-keyboard-on-the-android-emulator

 

July 24th

 

 

try { Thread.sleep ( 10000 ) ;

} catch (InterruptedException ie){}

 

 

 

July 26th

以下是 Android 的 View 物件中所包含的 EventListener

July 30th

用Iterator的时候遭遇删除操作:

August 2nd

Add code coverage to Android; running ant in eclipse

Set the argument “emma debug install test” in eclipse, you cannot run in command line because the dependence problem with robotium.

Sept 27th

Ant setting on windows

ad-hoc setting:

set ANT_HOME=c:ant

set PATH=%PATH%;%ANT_HOME%bin

export PATH=$PATH:/home

Spet 30th

Coverage.em is in bin directory

 

Oct 1st

 

When seed number is larger than 1500

 

INSTRUMENTATION_RESULT: shortMsg=Process crashed.

 

two observations:

1. random testing cannot identify the action be performed, has very low rate of hitting the valid action, which may result in a high overhead.

2. random testing may fall into the GUI action loop like performed same action against ListView.

3. Differentiate content and software structure.

4. The widget in navigation bar will be exercised many times.