Abstract
Due to various considerations, software vendors often translate their applications from one programming language to another, either manually or with the support of translation tools. Both these scenarios require translation of many call sites of API elements (i.e., classes, methods, and fields of API libraries). API mapping relations, either acquired by experienced programmers or already incorporated in translation tools, are much valuable in the translation process, since they describe mapping relations between source API elements and their equivalent target API elements. However, in an API mapping relation, a source API element and its target API elements may have behavioral differences, and such differences could lead to defects in the translated code. So far, to the best of our knowledge, there exists no previous study for exposing or understanding such differences. In this paper, we make the first attempt to expose and analyze behavioral differences in cross-language API mapping relations. From our result, we summarize eight findings and their implications that can improve effectiveness of translation tools, and also assist programmers in understanding the differences between mapped API elements of different languages during the translation process. Some exposed behavioral differences can indicate defects in translation tools, and four such new defects were confirmed by the developers of those tools.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Balaban, I., Tip, F., Fuhrer, R.: Refactoring support for class library migration. In: Proc. 20th OOPSLA, pp. 265–279 (2005)
Bartolomei, T., Czarnecki, K., Lammel, R.: Swing to SWT and back: Patterns for API migration by wrapping. In: Proc. ICSM, pp. 1–10 (2010)
Bartolomei, T.T., Czarnecki, K., Lämmel, R., van der Storm, T.: Study of an API Migration for Two XML APIs. In: van den Brand, M., Gašević, D., Gray, J. (eds.) SLE 2009. LNCS, vol. 5969, pp. 42–61. Springer, Heidelberg (2010)
Cabral, B., Marques, P.: Exception Handling: A Field Study in Java and.NET. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 151–175. Springer, Heidelberg (2007)
Cook, J., Dage, J.: Highly reliable upgrading of components. In: Proc. 21st ICSE, pp. 203–212 (1999)
Dig, D., Marrero, J., Ernst, M.: Refactoring sequential Java code for concurrency via concurrent libraries. In: Proc. 31st ICSE, pp. 397–407 (2009)
El-Ramly, M., Eltayeb, R., Alla, H.: An experiment in automatic conversion of legacy Java programs to C#. In: Proc. AICCSA, pp. 1037–1045 (2006)
Garcia, R., Jarvi, J., Lumsdaine, A., Siek, J.G., Willcock, J.: A comparative study of language support for generic programming. In: Proc. 18th OOPSLA, pp. 115–134 (2003)
Godefroid, P., Klarlund, N., Sen, K.: DART: Directed automated random testing. In: Proc. PLDI, pp. 213–223 (2005)
Henkel, J., Diwan, A.: CatchUp!: capturing and replaying refactorings to support API evolution. In: Proce. 27th ICSE, pp. 274–283 (2005)
Hou, D., Yao, X.: Exploring the intent behind API evolution: A case study. In: Proc. WCRE, pp. 131–140 (2011)
Jones, T.: Estimating software costs. McGraw-Hill, Inc., Hightstown (1998)
Kawrykow, D., Robillard, M.P.: Improving API usage through automatic detection of redundant code. In: Proc. ASE, pp. 111–122 (2009)
Koushik, S., Darko, M., Gul, A.: CUTE: a concolic unit testing engine for C. In: Proc. ESEC/FSE, pp. 263–272 (2005)
Meng, S., Wang, X., Zhang, L., Mei, H.: A history-based matching approach to identification of framework evolution. In: Proc. 34th ICSE, pp. 353–363 (2012)
Nita, M., Notkin, D.: Using twinning to adapt programs to alternative APIs. In: Proc. 32nd ICSE, pp. 205–214 (2010)
Pacheco, C., Lahiri, S., Ernst, M., Ball, T.: Feedback-directed random test generation. In: Proc. 29th ICSE, pp. 75–84 (2007)
Ravitch, T., Jackson, S., Aderhold, E., Liblit, B.: Automatic generation of library bindings using static analysis. In: Proc. PLDI, pp. 352–362 (2009)
Shi, L., Zhong, H., Xie, T., Li, M.: An Empirical Study on Evolution of API Documentation. In: Giannakopoulou, D., Orejas, F. (eds.) FASE 2011. LNCS, vol. 6603, pp. 416–431. Springer, Heidelberg (2011)
Song, M., Tilevich, E.: Enhancing source-level programming tools with an awareness of transparent program transformations. In: Proc. 24th OOPSLA, pp. 301–320 (2009)
Srivastava, V., Bond, M., McKinley, K., Shmatikov, V.: A security policy oracle: Detecting security holes using multiple API implementations. In: Proc. 32nd PLDI, pp. 343–354 (2011)
Taneja, K., Zhang, Y., Xie, T.: MODA: Automated test generation for database applications via mock objects. In: Proc. 26th ASE, pp. 289–292 (2010)
Thummalapenta, S., Xie, T., Tillmann, N., de Halleux, P., Schulte, W.: MSeqGen: Object-oriented unit-test generation via mining source code. In: Proc. ESEC/FSE, pp. 193–202 (2009)
Tillmann, N., de Halleux, J.: Pex–White Box Test Generation for .NET. In: Beckert, B., Hähnle, R. (eds.) TAP 2008. LNCS, vol. 4966, pp. 134–153. Springer, Heidelberg (2008)
Visser, W., Havelund, K., Brat, G., Park, S., Lerda, F.: Model checking programs. Automated Software Engineering 10(2), 203–232 (2003)
Xing, Z., Stroulia, E.: API-evolution support with Diff-CatchUp. IEEE Transactions on Software Engineering 33(12), 818–836 (2007)
Zhong, H., Thummalapenta, S., Xie, T., Zhang, L., Wang, Q.: Mining API mapping for language migration. In: Proc. 32nd ICSE, pp. 195–204 (2010)
Zhong, H., Zhang, L., Xie, T., Mei, H.: Inferring resource specifications from natural language API documentation. In: Proc. 24th ASE, pp. 307–318 (2009)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Zhong, H., Thummalapenta, S., Xie, T. (2013). Exposing Behavioral Differences in Cross-Language API Mapping Relations. In: Cortellessa, V., Varró, D. (eds) Fundamental Approaches to Software Engineering. FASE 2013. Lecture Notes in Computer Science, vol 7793. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-37057-1_10
Download citation
DOI: https://doi.org/10.1007/978-3-642-37057-1_10
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-37056-4
Online ISBN: 978-3-642-37057-1
eBook Packages: Computer ScienceComputer Science (R0)