Questions tagged [instrumentation]
The process of inserting extra diagnostic code during compilation of a given source code.
instrumentation
1,221
questions
69
votes
7
answers
36k
views
Trace vs Debug in .NET BCL
It seems that the
System.Diagnostics.Debug, and
System.Diagnostics.Trace
are largely the same, with the notable exception that Debug usage is compiled out in a release configuration.
When ...
48
votes
4
answers
34k
views
What is meant by the term "Instrumentation"? [duplicate]
As the title suggests. Many explanations are really vague, can anyone provide a more solid definition?
The term is used a lot in Android testing, but I don't think it's restricted to that platform.
44
votes
1
answer
2k
views
Write/create file within Android Instrumentation context
I have a class that creates (or opens) a file to write some data to it. This class receives a Context in the constructor, saves it in an instance field, and then uses it to call the context....
42
votes
5
answers
8k
views
What is instrumentation?
I've heard this term used a lot in the same context as logging, but I can't seem to find a clear definition of what it actually is.
Is it simply a more general class of logging/monitoring tools and ...
32
votes
2
answers
24k
views
How to discover table properties from SQLAlchemy mapped object
I have a class mapped with a table, in my case in a declarative way, and I want to "discover" table properties, columns, names, relations, from this class:
engine = create_engine('sqlite:///' + ...
29
votes
5
answers
45k
views
How can I deliver parameters to a test function, that launched using adb shell am Instrumentation command
I am developing in Android, I am using instrumentation to test Phone application.
Instrumentation is Android env to test applications.
For that I use am command with name of test case.
I run adb, ...
28
votes
3
answers
18k
views
How do you force an orientation change in an Android Instrumentation test?
I'm writing some acceptance tests for an application using the ActivityInstrumentationTestCase2 class. I want to cause an orientation change from within the test to ensure that a number of things ...
28
votes
3
answers
21k
views
android.util.AndroidException: INSTRUMENTATION_FAILED:
I have a simple android app and I am testing it using my phone. So, there are two ways to do that :
Using eclipse
Using CLI
Problem:
When I run unit test case using Eclipse, it installs app on my ...
27
votes
6
answers
10k
views
How can I profile Signed Assemblies with VS 2010 or VS 2013
I have a website that uses AjaxControlToolkit.dll and Log4Net.dll.
When I try to run the performance profiling tool in VS 2010 on it it gives me the following warning:
AjaxControlToolkit.dll is ...
26
votes
2
answers
5k
views
Android NullPointerException in Instrumentation.execStartActivity
I keep getting the bellow exception from some users:
java.lang.NullPointerException
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1414)
at android.app.Activity....
25
votes
3
answers
23k
views
Tools to analyze core dump from Node.js [closed]
If I use gcore to make a code dump of a Node.js process, what are the best tools to analyze it?
Inspired by:
Tool for analyzing java core dump
In my specific case, I'm interested in investigating ...
23
votes
4
answers
36k
views
"Failed to load Premain-Class manifest attribute" while trying to get the size of an object using java agent
When i try to run a java program (java -javaagent:size.jar ObjectSizeTest) i get the following error:
Failed to load Premain-Class manifest attribute from D:\workspace\ObjectSizeTest\size.jar
Error ...
22
votes
4
answers
11k
views
Accessing instrumentation test resources
I am trying to find a way for my instrumentation tests to have access to string resources generated within the test package.
More details:
I have an Android test case which inherits from ...
22
votes
2
answers
4k
views
Difference between ActivityUnitTestCase and ActivityInstrumentationTestCase2
I am new to Android Instrumentation cases. i have been looking at the API samples and see that sometimes we use ActivityUnitTestCase and the ActivityInstrumentationTestCase2. What is the difference ...
21
votes
7
answers
5k
views
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 ...
21
votes
4
answers
40k
views
PL/SQL Logging - How to control?
I am looking to introduce a logging framework into our existing Oracle application to replace the use of DBMS_OUTPUT.
The framework will be used primarly to aid debugging and would detail such ...
20
votes
2
answers
11k
views
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 ...
20
votes
2
answers
8k
views
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 ...
20
votes
3
answers
15k
views
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....
19
votes
1
answer
1k
views
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 ...
18
votes
1
answer
15k
views
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?
18
votes
4
answers
11k
views
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 ...
17
votes
8
answers
9k
views
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 ...
17
votes
1
answer
3k
views
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 { ...
17
votes
1
answer
438
views
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" # ...
16
votes
4
answers
9k
views
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 ...
16
votes
6
answers
11k
views
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,...
15
votes
3
answers
8k
views
proguard gradle debug build but not the tests
I enabled proguard for the debug build using:
android {
buildTypes {
debug {
runProguard true
proguardFile 'proguard-debug.txt'
}
release {
...
15
votes
2
answers
4k
views
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$...
15
votes
1
answer
4k
views
javassist loading a class file in the pre-main method (java instrumentation)
I'm trying to load a specific class using javassist, I'm doing this inside a pre-main method as the follwoing:
public byte[] transform(ClassLoader loader, String className, Class<?> ...
15
votes
1
answer
4k
views
Debugging A Java Agent
I'm currently developing a Java Agent in order to facilitate the dynamic instrumentation of new and legacy Java Applications.
It occurred to me that, as far as IDE debugging is concerned, Java ...
15
votes
4
answers
4k
views
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 ...
15
votes
1
answer
555
views
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....
14
votes
4
answers
8k
views
Measuring performance in Python
I'm writing a web-application in Python, I haven't decided if I want to use Flask, web.py or something else yet, and I want to be able to do profile on the live application.
There seems to be very ...
14
votes
3
answers
790
views
Asserting order of synchronization in Java
In highly concurrent systems, it can be difficult to be confident that your usage of locks is correct. Specifically, deadlocks can result if locks are acquired in an order that was not expected while ...
13
votes
2
answers
8k
views
Adding code to a Java class w/ Instrumentation: ASM or BCEL?
I am writing a game engine/library in which I have an event dispatcher class which dispatches events by calling listener methods of "registered" event handler classes. One can register an event ...
13
votes
2
answers
7k
views
Why is there no test instrumentation for BroadcastReceiver?
Maybe I'm missing something. I want to write test cases for a BroadcastReceiver; specifically, it is for receiving the BOOT_COMPLETED event and setting an alarm for another receiver to handle later; ...
13
votes
2
answers
13k
views
How do I log at verbose level using `System.Diags...Trace`
Okay don't laugh. In 2005 I read about tracing using System.Diagnostics namespace, it was complicated and I have used log4net and NLog ever since (and so has everyone else).
Today, my app will be ...
12
votes
3
answers
10k
views
How to pass an argument to an AndroidTestCase?
I've implemented an Instrumentation and an AndroidTestCase.
For my tests I need to connect to an external WIFI device. I want the testers to be able to specify an SSID for the test to use.
Giving ...
12
votes
1
answer
7k
views
What is the use of agentmain method in java instrumentation
I done some java bytecode instrumentation with -javaagent argument and premain method. But this is the first time i hear about agentmain method. I have some questions about this method. Here follows ...
12
votes
5
answers
14k
views
How to get started with WCF Performance profiling
I'm trying to figure out how to profile a WCF service so I can identify any bottlenecks.
I have found a bit of information on line, but nothing that assumes no prior knowlege which is where I'm at.
...
12
votes
2
answers
6k
views
Instrumenting C/C++ code using LLVM
I want to write a LLVM pass to instrument every memory access.
Here is what I am trying to do.
Given any C/C++ program (like the one given below), I am trying to insert calls to some function, before ...
12
votes
1
answer
649
views
InstrumentationTestRunner: What does android:functionalTest achieve?
I am wondering what InstrumentationInfo#functionalTest is supposed to achieve. Does it have any impact on how the application environment is started?
12
votes
3
answers
19k
views
Calculating byte-size of Java object [duplicate]
I am working on calculaitng the size [memory used] of a java object [hashmap] . It contains elements of different data types [at runtime] so [ no-of-elem * size-of-element] is not that good an ...
12
votes
1
answer
3k
views
.Net Binary Deserialization Failure detection/forensics for runtime platform
I'm looking for insight on how to instrument a runtime platform to expose the source type of a Microsoft .Net binary deserialization failure.
When using BinaryFormatter.Deserialize(...
12
votes
3
answers
3k
views
Spring @Autowired fails in case of Cobertura instrumented class
Question
Cobertura instrumentation is breaking springs autowiring in a specific case. Does anyone know how to resolve this?
Scenario
I am running MVN 3.0.4 with the cobertura-maven-plugin version 2....
11
votes
5
answers
10k
views
Wrapping a function in Javascript / jQuery
If I have an arbitrary function myFunc, what I'm aiming to do is replace this function with a wrapped call that runs code before and after it executes, e.g.
// note: psuedo-javascript
var ...
11
votes
2
answers
797
views
How to understand and learn `instrument` package of java?
Recently, I found there is a java.lang.instrument package in jdk, which is used by many frameworks to reload classes or profile.
I don't find many articles of using them, is there any resource(book, ...
11
votes
5
answers
6k
views
Slow down Espresso
this is regarding Espresso. I am successfully running integration test on a simulator. I think some tests are failing because it's running too fast. Is there a way to slowdown the execution/playback ...
11
votes
2
answers
3k
views
C++ function instrumentation via clang++'s -finstrument-functions : how to ignore internal std library calls?
Let's say I have a function like:
template<typename It, typename Cmp>
void mysort( It begin, It end, Cmp cmp )
{
std::sort( begin, end, cmp );
}
When I compile this using -finstrument-...