Questions tagged [instrumentation]

The process of inserting extra diagnostic code during compilation of a given source code.

The process of inserting extra diagnostic code during compilation of a given source code. Instrumentation can involve adding extra debugging information or providing hooks into profilers and other utilities in order to provide extra feedback to the developer.

1193 questions
20
votes
2 answers

Does java have any mechanism for a VM to trace method calls on itself, without using javaagent, etc?

I want to build call graphs on the fly, starting at an arbitrary method call or with a new thread, which ever is easier, from within the running JVM itself. (this piece of software is going to be a test fixture for load testing another piece of…
marathon
  • 7,881
  • 17
  • 74
  • 137
20
votes
3 answers

Testing onActivityResult()

I have the following Activity: package codeguru.startactivityforresult; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import…
Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
19
votes
7 answers

What information should I be logging in my web app?

I finishing up a web application and I'm trying to implement some logging. I've never seen any good examples of what to log. Is it just exceptions? Are there other things I should be logging? What type of information do you find useful for finding…
Micah
  • 111,873
  • 86
  • 233
  • 325
19
votes
2 answers

Instrumenting C/C++ codes using LLVM

I just read about the LLVM project and that it could be used to do static analysis on C/C++ codes using the analyzer Clang which the front end of LLVM. I wanted to know if it is possible to extract all the accesses to memory(variables, local as well…
Himanshu Shekhar
  • 437
  • 1
  • 5
  • 16
19
votes
1 answer

How to make a ArrayList using Javassist

I want to add a arrayList into a method during instrumentation. I tried it as mentioned in (Javassist CannotCompileException when trying to add a line to create a Map) but it throws a different exception with a java.lang.VerifyError. public void…
udani
  • 1,243
  • 2
  • 11
  • 33
18
votes
4 answers

Identify loops in java byte code

I am trying to instrument java byte code. I want to recognize the entry and exit of a java loop, but I have found the identification of loops to be quite challenging. I have spent a good few hours looking at ASM and open source de-compilers (whom I…
user858203
  • 315
  • 1
  • 2
  • 7
18
votes
1 answer

How do I pass arguments to a Java instrumentation agent?

How do I pass arguments to a java.lang.instrument instrumentation agent? The documentation simply states: -javaagent:jarpath[=options] What options can I select?
Duncan Jones
  • 67,400
  • 29
  • 193
  • 254
17
votes
8 answers

Is it possible to find out if an Android application runs as part of an instrumentation test

Is there a runtime check for an application to find out if it runs as part of an instrumentation test? Background: Our application performs a database sync when starting. But that should happen only when started regularly. It especially interferes…
Martin
  • 11,577
  • 16
  • 80
  • 110
17
votes
1 answer

Add new registers on Dalvik bytecode

everyone. I met a problem on instrumentation on Dalvik bytecode. The origin bytecode is: virtual methods .method public onClick(Landroid/view/View;)V .locals 12 .param p1, "v" # Landroid/view/View; ... return-void .end…
user3496149
  • 171
  • 4
16
votes
4 answers

GUI testing with Instrumentation in Android

I want to test my Android applications UI, with keyevents and pressed buttons and so on. I've read som documentation that Instrumentation would be able to use for this purpose. Anyone with expericence with using Instrumentation for UI testing?
Sara
  • 3,733
  • 6
  • 26
  • 30
16
votes
6 answers

Visual Studio Performance Profiling - Class library symbols could not be found

I'm trying to Instrument an ASP.NET web-application with Visual Studio 2012, .NET 4. The solution contains a web-application and a class library. The problem is I can't see step into the class library, I get a message stating: Matching symbols could…
kipusoep
  • 2,174
  • 6
  • 24
  • 34
15
votes
1 answer

Android weird test sharding

I'm experimenting with test sharding on Android and I'm getting pretty weird results: + adb -s emulator-5580 shell am instrument -e numShards 2 -e shardIndex 0 -e class com.package.etc.automation.Tests.SanityTest.SanityTest -w…
Łukasz Sromek
  • 3,637
  • 3
  • 30
  • 43
15
votes
4 answers

Android Studio: Cannot write to Shared Preferences in instrumented test

I'm trying to write a test case to verify a class that writes to Shared Preferences. I'm using Android Studio v1.5. In the good old eclipse, when using AndroidTestCase, a second apk file was deployed to the device, and tests could be run using the…
15
votes
2 answers

Transforming lambdas in Java 8

Java 8 appears to generate classes to represent lambda expressions. For instance, the code: Runnable r = app::doStuff; Manifests, roughly, as: // $FF: synthetic class final class App$$Lambda$1 implements Runnable { private final App…
BitPusher
  • 990
  • 1
  • 9
  • 20
15
votes
1 answer

connectedAndroidTest and release build type

I'm using gradle:1.2.3 I would like to run my androidConntectTests (instrumentation tests) on release (signed, minified) configuration, but I cannot. My build types: buildTypes { debug { minifyEnabled false debuggable…
Max
  • 446
  • 4
  • 16
1
2
3
79 80