Program: 53308
Project: 53308
Buggy source:
@Test public void testSimpleGenAidlRule() throws IOException {
  BuildContext context=null;
  String pathToAidl="String_Node_Str";
  String importPath="String_Node_Str";
  BuildRuleResolver ruleResolver=new BuildRuleResolver();
  GenAidlRule genAidlRule=ruleResolver.buildAndAddToIndex(GenAidlRule.newGenAidlRuleBuilder(new FakeAbstractBuildRuleBuilderParams()).setBuildTarget(BuildTargetFactory.newInstance("String_Node_Str")).setAidl(pathToAidl).setImportPath(importPath));
  assertEquals(BuildRuleType.GEN_AIDL,genAidlRule.getType());
  assertTrue(genAidlRule.isAndroidRule());
  assertEquals(ImmutableList.of(pathToAidl),genAidlRule.getInputsToCompareToOutput());
  List<Step> steps=genAidlRule.buildInternal(context);
  final String pathToAidlExecutable="String_Node_Str";
  final String pathToFrameworkAidl="String_Node_Str";
  AndroidPlatformTarget androidPlatformTarget=createMock(AndroidPlatformTarget.class);
  File aidlExecutable=createMock(File.class);
  expect(aidlExecutable.getAbsolutePath()).andReturn(pathToAidlExecutable);
  expect(androidPlatformTarget.getAidlExecutable()).andReturn(aidlExecutable);
  File frameworkIdlFile=createMock(File.class);
  expect(frameworkIdlFile.getAbsolutePath()).andReturn(pathToFrameworkAidl);
  expect(androidPlatformTarget.getAndroidFrameworkIdlFile()).andReturn(frameworkIdlFile);
  ExecutionContext executionContext=createMock(ExecutionContext.class);
  expect(executionContext.getAndroidPlatformTarget()).andReturn(androidPlatformTarget);
  expect(executionContext.getProjectFilesystem()).andReturn(new ProjectFilesystem(new File("String_Node_Str")){
    @Override public Function<String,String> getPathRelativizer(){
      return Functions.identity();
    }
  }
);
  replay(androidPlatformTarget,aidlExecutable,frameworkIdlFile,executionContext);
  String outputDirectory=String.format("String_Node_Str",BuckConstant.GEN_DIR,importPath);
  MkdirStep mkdirStep=(MkdirStep)steps.get(0);
  assertEquals("String_Node_Str" + outputDirectory,mkdirStep.getPath(executionContext),outputDirectory);
  MoreAsserts.assertShellCommands("String_Node_Str",ImmutableList.of(String.format("String_Node_Str",pathToAidlExecutable,pathToFrameworkAidl,importPath,outputDirectory,pathToAidl)),steps.subList(1,2),executionContext);
  verify(androidPlatformTarget,aidlExecutable,frameworkIdlFile,executionContext);
}

Fixed version (ground truth):
@Test public void testSimpleGenAidlRule() throws IOException {
  BuildContext context=null;
  String pathToAidl="String_Node_Str";
  String importPath="String_Node_Str";
  BuildRuleResolver ruleResolver=new BuildRuleResolver();
  GenAidlRule genAidlRule=ruleResolver.buildAndAddToIndex(GenAidlRule.newGenAidlRuleBuilder(new FakeAbstractBuildRuleBuilderParams()).setBuildTarget(BuildTargetFactory.newInstance("String_Node_Str")).setAidl(pathToAidl).setImportPath(importPath));
  assertEquals(BuildRuleType.GEN_AIDL,genAidlRule.getType());
  assertTrue(genAidlRule.isAndroidRule());
  assertEquals(ImmutableList.of(pathToAidl),genAidlRule.getInputsToCompareToOutput());
  List<Step> steps=genAidlRule.buildInternal(context);
  final String pathToAidlExecutable="String_Node_Str";
  final String pathToFrameworkAidl="String_Node_Str";
  AndroidPlatformTarget androidPlatformTarget=createMock(AndroidPlatformTarget.class);
  File aidlExecutable=createMock(File.class);
  expect(aidlExecutable.getAbsolutePath()).andReturn(pathToAidlExecutable);
  expect(androidPlatformTarget.getAidlExecutable()).andReturn(aidlExecutable);
  File frameworkIdlFile=createMock(File.class);
  expect(frameworkIdlFile.getAbsolutePath()).andReturn(pathToFrameworkAidl);
  expect(androidPlatformTarget.getAndroidFrameworkIdlFile()).andReturn(frameworkIdlFile);
  ExecutionContext executionContext=createMock(ExecutionContext.class);
  expect(executionContext.getAndroidPlatformTarget()).andReturn(androidPlatformTarget);
  expect(executionContext.getProjectFilesystem()).andReturn(new ProjectFilesystem(new File("String_Node_Str")){
    @Override public Function<String,String> getPathRelativizer(){
      return Functions.identity();
    }
  }
);
  replay(androidPlatformTarget,aidlExecutable,frameworkIdlFile,executionContext);
  String outputDirectory=String.format("String_Node_Str",BuckConstant.GEN_DIR,importPath);
  MkdirStep mkdirStep=(MkdirStep)steps.get(0);
  assertEquals("String_Node_Str" + outputDirectory,mkdirStep.getPath(executionContext),outputDirectory);
  ShellStep aidlStep=(ShellStep)steps.get(1);
  assertEquals("String_Node_Str",String.format("String_Node_Str",pathToAidlExecutable,pathToFrameworkAidl,importPath,outputDirectory,pathToAidl),aidlStep.getDescription(executionContext));
  assertEquals(2,steps.size());
  verify(androidPlatformTarget,aidlExecutable,frameworkIdlFile,executionContext);
}