Java-first quickstart for testing FTC and Pedro Pathing robot code in an Android Studio project without needing a connected robot.
This README intentionally focuses on the Java source files under app/src.
Excluded from this write-up:
- XML resources
AndroidManifest.xml- themes, icons, backup rules, and other generated/template Android resource files
This project is a small testing scaffold for writing and running robot-related Java code locally. It is set up as an Android app module, but the most important pieces in the repo right now are the Java classes used for:
- referencing FTC SDK types
- referencing Pedro Pathing types
- organizing local JVM unit tests
- providing a sample Android instrumented test
When adding your own code to this project, use these folders consistently:
app/src/main/javafor robot code, utilities, helpers, and any production classes you want to testapp/src/test/javafor local unit tests that run on your computer's JVMapp/src/androidTest/javafor Android/instrumented tests that need a device, emulator, or Android framework access
Recommended workflow:
- Put the code you actually want to test in
main - Put fast logic-focused tests in
test - Put hardware/framework/device-dependent tests in
androidTest
For this repo, that means:
- robot logic classes should go under
app/src/main/java/com/test - plain verification code should go under
app/src/test/java/com/test - Android-dependent verification should go under
app/src/androidTest/java/com/test
This project supports two different testing styles.
Use local unit tests when:
- you are testing pure logic
- you want fast feedback
- your code does not need a real Android device or Android framework runtime
Characteristics:
- runs on the local JVM
- usually faster than instrumented tests
- good for math, state transitions, path calculations, helper methods, and business logic
In this repo:
ExampleUnitTest.javais the example local unit testTestAll.javais a custom aggregator that can run selected local test classes together
Use Android tests when:
- you need
Context - you need Android framework APIs
- you need behavior that depends on an emulator, device, or Android runtime
Characteristics:
- runs on an Android device or emulator
- slower than local JVM tests
- useful for Android integration behavior and framework-dependent code
In this repo:
ExampleInstrumentedTest.javais the example Android test- it checks the package name using the target app
Context
If the code can be tested without Android, put the test in test.
If the code requires Android runtime objects like Context, framework services, or device execution, put the test in androidTest.
This file is a placeholder/example class showing that the project can resolve and use classes from both the FTC SDK and Pedro Pathing libraries.
It demonstrates references to:
- FTC SDK classes such as
OpMode,OpModeManagerImpl, andServo - Pedro Pathing classes such as
Follower,FollowerConstants,PinpointLocalizer, andMecanum
The file is not a full robot implementation. Instead, it acts as a proof-of-setup file that shows how code in this repository can access the libraries needed for robot logic and pathing experiments.
This is the custom local test runner for the repository.
What it does:
- defines
configuredClasses() - registers test classes by assigning
testClasses(testClasses is the list of local test classes that will be run when this runner is executed) - reflects over each configured class
- finds methods annotated with
@Test - constructs an instance of each class and invokes its test methods
Right now it is configured to run:
ExampleUnitTest.class
This file is useful when you want one top-level test entry point that runs a hand-picked set of unit test classes.
This is the sample local JVM test.
Current behavior:
- contains
addition_isCorrect() - asserts that
2 + 2 == 4
This class serves as the simplest example of how core logic tests can be added under app/src/test/java.
This is the sample Android instrumented test that runs on a device or emulator.
Current behavior:
- gets the target app
Context - verifies the package name is
com.test
This is the place for tests that require the Android framework, device APIs, or behavior that cannot run as a plain JVM unit test.
The app module declares:
implementation(libs.bundles.ftc)
That bundle is defined in gradle/libs.versions.toml and groups the main robotics/pathing dependencies used by this project.
In other words, this repository uses:
- the FTC SDK
- Pedro Pathing
- Pedro Addons (ivy, telemetry for Pedro Tuning)
- Bylazar FullPanels
through the shared libs.bundles.ftc dependency bundle.
At a high level:
- Java robot-related code lives in
app/src/main/java - Plain logic tests live in
app/src/test/java - Android/device-dependent tests live in
app/src/androidTest/java TestAllcan be used as a manual aggregation point for selected local test classes
Use this pattern whenever you add a new feature or subsystem.
Create your actual implementation classes under:
app/src/main/java/com/test
Examples of what belongs there:
- drivetrain helpers
- subsystem logic
- motion/path utilities
- calculation helpers
- wrappers around FTC, Panels or Pedro Pathing behavior
For logic that can run without Android, create a matching test class under:
app/src/test/java/com/test
Basic pattern:
- create a test class
- add methods annotated with
@Test - assert expected behavior with JUnit assertions
If you want the class included in the custom aggregated runner, add it to TestAll.configuredClasses().
For code that needs Android runtime behavior, create tests under:
app/src/androidTest/java/com/test
Use this for:
Context-dependent code- Android framework integration
- behavior that only makes sense on a device or emulator
Open the repository in Android Studio.
Let Android Studio sync the project so the dependencies from libs.bundles.ftc are available.
That bundle provides:
- FTC SDK dependencies
- Bylazar Full Panels dependencies
- Pedro Pathing dependencies
- Pedro Addons (ivy, telemetry for Pedro Tuning)
Start by replacing placeholder.java or by adding new classes beside it in:
app/src/main/java/com/test
Keep the production code in main, not in test.
For every logic-heavy class, add one or more local tests under:
app/src/test/java/com/test
This is the best place for:
- calculations
- state-machine behavior
- path or control logic that does not require Android runtime
If you want one top-level suite, edit TestAll.configuredClasses() and add your local test classes there.
Example idea:
- add
DriveMathTest.class - add
ArmControllerTest.class - add
PathPlannerTest.class
Then run the aggregated suite through TestAll.
Only place tests in androidTest when they need Android-specific behavior.
This keeps most of your tests fast and easy to run locally.
Run all local unit tests:
./gradlew testDebugUnitTestRun only the custom local suite:
./gradlew testDebugUnitTest --tests com.test.TestAllRun one local test class directly:
./gradlew testDebugUnitTest --tests com.test.ExampleUnitTestRun instrumented tests on a device or emulator:
./gradlew connectedDebugAndroidTest- Keep all real robot/application code in
main - Write most tests in
test - Use
androidTestonly for Android-specific behavior - Use
TestAllif you want a manual, curated test suite entry point - Grow the repo by replacing
placeholder.javawith real subsystems and utilities
This repository is currently more of a testing starter/scaffold than a complete app. The Java files show:
- how to reference FTC SDK code
- how to reference Pedro Pathing code
- how to organize local tests
- how to add an instrumented Android test
The next logical step would be to replace placeholder.java with real robot subsystems, utilities, and logic classes, then add corresponding tests under app/src/test/java.