Syntax-Directed Amorphous Slicing
Tóm tắt
An amorphous slice of a program is constructed with respect to a set of variables. The amorphous slice is an executable program which preserves the behaviour of the original on the variables of interest. Unlike syntax-preserving slices, amorphous slices need not preserve a projection of the syntax of a program. This makes the task of amorphous slice construction harder, but it also often makes the result thinner and thereby preferable in applications where syntax preservation is unimportant. This paper describes an approach to the construction of amorphous slices which is based on the Abstract Syntax Tree of the program to be sliced, and does not require the construction of control flow graphs nor of program dependence graphs. The approach has some strengths and weaknesses which the paper discusses. The amorphous slicer, is part of the GUSTT slicing system, which includes syntax preserving static and conditioned slicers, a side effect removal transformation phase, slicing criterion guidance and for which much of the correctness proofs for transformation steps are mechanically verified. The system handles a subset of WSL, into which more general WSL constructs can be transformed. The paper focuses upon the way in which the GUSTT System uses dependence reduction transformation tactics. Such dependence reduction is at the heart of all approaches to amorphous slicing. The algorithms used are described and their performance is assessed with a simple empirical study of best and worst case execution times for an implementation built on top of the FermaT transformation system for maintenance and re-engineering.
Tài liệu tham khảo
Agrawal, H. 1994. On slicing programs with jump statements. In ACM SIGPLAN Conference on Programming Language Design and Implementation, Orlando, Florida, pp. 302–312. Proceedings in SIGPLAN Notices, 29(6), June 1994.
Aho, A.V., Sethi, R., and Ullman, J.D. 1986. Compilers: Principles, Techniques and Tools. Addison Wesley.
Apt, K.R. Brunekreef, J., Partington, V., and Schaerf, A. 1998. Alma-O: An imperative language that supports declarative programming. ACM Transactions on Programming Languages and Systems, 20(5):1014–1066.
Ball, T. and Horwitz, S. 1993. Slicing programs with arbitrary control-flow. In Peter Fritzson, editor, 1st Conference on Automated Algorithmic Debugging, 1993. Linköping, Sweden: Springer. pp. 206–222, Also available as University of Wisconsin-Madison, technical report (in extended form), TR-1128, Dec. 1992.
Bennett, K., Bull, T., Younger, E., and Luo, Z. 1995. Bylands: Reverse engineering safety-critical systems. In IEEE International Conference on Software Maintenance, Los Alamitos, CA, USA: IEEE Computer Society Press, pp. 358–366.
Bennett, K.H. 1998. Do program transformations help reverse engineering? In IEEE International Conference on Software Maintenance (ICSM'98), Bethesda, Maryland, USA, pp. 247–254. IEEE Computer Society Press: Los Alamitos, California, USA.
Biggerstaff, T.J., Mitbander, B., and Webster,D. 1993. The concept assignment problem in program understanding. In 15th International Conference on Software Engineering, Baltimore, Maryland. Los Alamitos, CA, USA: IEEE Computer Society Press.
Binkley, D.W. 1998. The application of program slicing to regression testing. In M. Harman and K. Gallagher, editors, Information and Software Technology Special Issue on Program Slicing, Elsevier, vol. 40, pp. 583–594.
Binkley, D.W. 1999. Computing amorphous program slices using dependence graphs and a data-flow model. In ACM Symposium on Applied Computing, pp. 519–525, The Menger, San Antonio, Texas, USA, New York, NY, USA: ACM Press.
Binkley, D.W. and Gallagher, K.B. 1996. Program slicing. In M. Zelkowitz, editor, Advances in Computing, Volume 43, Academic Press, pp. 1–50.
Binkley, D.W., Harman, M., Raszewski, L.R., and Smith, C. 2000. An empirical study of amorphous slicing as a program comprehension support tool. In 8th IEEE International Workshop on Program Comprehension (IWPC 2000), Limerick, Ireland. IEEE Computer Society Press: Los Alamitos, California, USA, pp. 161–170.
Bull, T. 1994. Software maintenance by program transformation in a wide spectrum language. PhD thesis, University of Durham, UK, School of Engineering and Computer Science.
Canfora, G. Cimitile, A., and De Lucia, A. 1998. Conditioned program slicing. In M. Harman and K. Gallagher, editors, Information and Software Technology Special Issue on Program Slicing, vol. 40, pp. 595–607. Elsevier Science B.V.
Choi, J.-D. and Ferrante, J. 1994. Static slicing in the presence of goto statements. ACM Transactions on Programming Languages and Systems, 16(4):1097–1113.
Coquand, T. and Huet, G. 1988. The calculus of constructions. Information and Computation, 76:96–120.
Coquand, T. and Paulin, C. 1990. Inductively defined types (preliminary version). In P. Martin-Löf and G. Mints, editors, Proceedings Int.Conf.on Computer Logic, COLOG'88, Tallinn, USSR, 12–16 Dec.1988, vol. 417 of Lecture Notes in Computer Science. Berlin: Springer-Verlag, pp. 50-66.
Corbett, J.C., Dwyer, M.B., Hatcliff, J., Laubach, S., Pasareanu, C.S., Robby and Zheng, H. 2000. Bandera: Extracting finite-state models from java source code. In 22nd International Conference on Software Engineering (ICSE'2000), pp. 439–448. Los Alamitos, CA, USA: IEEE Computer Society Press.
Cornes, C., Courant, J. Filliatre, J.-C., Huet, G., Manoury, P., Munoz, C., Murthy, C., Paulin-Mohring, C., Saibi, A., and Werner, B. 1995. The coq proof assistant, reference manual, version 5.10. Technical Report RT-0177, Inria, Institut National de Recherche en Informatique et en Automatique.
Danicic, S., Fox, C., Harman, M., and Mark Hierons, R. 2000. ConSIT: A conditioned program slicer. In IEEE International Conference on Software Maintenance (ICSM'00), San Jose, CA, USA, pp. 216–226. Los Alamitos, CA. USA: IEEE Computer Society Press.
Danicic, S. and Harman, M. 2000. Espresso: A slicer generator. In ACM Symposium on Applied Computing, (SAC'00), Como, Italy, pp. 831–839.
Daoudi, M., Danicic, S., Howroyd, J., Harman, M., Fox, C., Ouarbya, L., and Ward, M. 2002. ConSUS: A scalable approach to conditioned slicing. In IEEE Working Conference on Reverse Engineering (WCRE 2002), Richmond, Virginia, USA, pp. 109–118, Los Alamitos, CA, USA: IEEE Computer Society Press, Invited for special issue of the Journal of Systems and Software as best paper from WCRE 2002.
Darlington, J. and Burstall, R.M. 1976. A system which automatically improves programs. Acta Informatica, 6:41–60.
Das, M. 1998. Partial evaluation using dependence graphs. PhD thesis, University of Wisconsin-Madison.
De Lucia, A. 2001. Program slicing: Methods and applications. In 1st IEEE International Workshop on Source Code Analysis and Manipulation, Florence, Italy, pp. 142–149. Los Alamitos, California, USA: IEEE Computer Society Press.
De Lucia, A., Fasolino, A.R., and Munro, M. 1996 Understanding function behaviours through program slicing. In 4th IEEE Workshop on Program Comprehension, Berlin, Germany, pp. 9–18. Los Alamitos, CA, USA: IEEE Computer Society Press.
De Millo, R.A., Lipton, R.J., and Perlis, A.J. 1979. Social processes and proofs of theorems and programs. Communications of the ACM, 22(5):271–280. An earlier version appeared in ACM Symposium on Principles of Programming Languages (POPL), Los Angeles, California, 1977, pp. 206-214.
Ernst, M.D. 1994. Practical fine-grained static slicing of optimised code. Technical Report MSR-TR–94-14, Microsoft research, Redmond, WA.
Field, J. and Ramalingam, C. 1999. Identifying procedural structure in cobol programs. In Proceedings of the ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, vol. 24.5 of Software Engeneering Notes (SEN), pp. 1–10. 1999. NY: ACM Press.
Field, J., Ramalingam, G., and Tip, F. 1995. Parametric program slicing. In 22nd ACM Symposium on Principles of Programming Languages, San Francisco, CA, pp. 379–392.
Gerber, R. and Hong, S. 1997. Slicing real-time programs for enhanced schedulability. ACM Transactions on Programming Languages and Systems, 19(3):525–555.
Gold, N.E. 2000. Hypothesis-based concept assignment to support software maintenance. PhD Thesis, Department of Computer Science, University of Durham.
Gold, N.E. 2001. Hypothesis-based concept assignment to support software maintenance. In IEEE International Conference on Software Maintenance (ICSM'01), Florence, Italy, pp. 545–548. Los Alamitos, CA, USA: IEEE Computer Society Press.
Grammatech Inc. 2002. The codesurfer slicing system.
Gupta, R., Harrold, M.J., and Soffa, M.L. 1992. An approach to regression testing using slicing. In Proceedings of the IEEE Conference on Software Maintenance, Orlando, Florida, USA. Los Alamitos, CA, USA: IEEE Computer Society Press, pp. 299–308.
Harman, M. Binkley, D.W. and Danicic, S. 2003. Amorphous program slicing. Journal of Systems and Software, 68(1):45–64.
Harman, M. and Danicic, S. 1995. Using program slicing to simplify testing. Software Testing, Verification and Reliability, 5(3): 143–162.
Harman, M. and Danicic, S. 1997. Amorphous program slicing. In 5th IEEE International Workshop on Program Comprenhesion (IWPC'97), Dearborn, MI, USA, pp. 70–79. Los Alamitos, CA, USA: IEEE Computer Society Press.
Harman, M. and Danicic, S. 1998. A new algorithm for slicing unstructured programs. Journal of Software Maintenance and Evolution, 10(6):415–441.
Harman, M., Gold, N., Hierons, R.M., and Binkley, D. 2002a. Code extraction algorithms which unify slicing and concept assignment. In IEEE Working Conference on Reverse Engineering (WCRE 2002), pp. 11–21, Richmond, Virginia, USA. IEEE Computer Society Press, Los Alamitos, California, USA.
Harman, M. and Hierons, R.M. 2001. An overview of program slicing. Software Focus, 2(3):85–92.
Harman, M., Hu, L., Hierons, R., Baresel, A., and Sthamer, H. 2002b. Improving evolutionary testing by flag removal ('best at GECCO' award winner). In GECCO 2002: Proceedings of the Genetic and Evolutionary Computation Conference, New York, pp. 1359–1366. Morgan Kaufmann Publishers.
Harman, M., Hu, L., Hierons, R.M., Zhang, X., Munro, M., Dolado, J.J., Otero, M.C., and Wegener, J. 2002c. A post-placement side-effect removal algorithm. In IEEE International Conference on Software Maintenance (ICSM 2002), Montreal, Canada, pp. 2–11. Los Alamitos, CA, USA: IEEE Computer Society Press.
Harman, M., Hu, L., Zhang, X., and Munro, M. 2001. GUSTT: An amorphous slicing system which combines slicing and transformation. In 1stWorkshop on Analysis, Slicing, and Transformation (AST 2001), pp. 271–280, Stuttgart. Los Alamitos, CA, USA: IEEE Computer Society Press.
Harman, M., Hu, L., Zhang, X., and Munro, M. 2001. Side-effect removal transformation. In 9th IEEE International Workshop on Program Comprehension (IWPC'01), pp. 310–319, Toronto, Canada. Los Alamitos, CA, USA: IEEE Computer Society Press.
Harman, M., Sivagurunathan, Y., and Danicic, S. 1998. Analysis of dynamic memory access using amorphous slicing. In IEEE International Conference on Software Maintenance (ICSM'98), pp. 336–345, Bethesda, Maryland, USA. Los Alamitos, CA, USA: IEEE Computer Society Press.
Hierons, R.M., Harman, M., and Danicic, S. 1999. Using program slicing to assist in the detection of equivalent mutants. Software Testing, Verification and Reliability, 9(4):233–262.
Horwitz, S., Reps, T., and Binkley, D.W. 1988. Interprocedural slicing using dependence graphs. In ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 25–46, Atlanta, Georgia. Proceedings in SIGPLAN Notices, 23(7):35-46.
Horwitz, S., Reps, T., and Binkley,D.W. 1990. Interprocedural slicing using dependence graphs. ACMTransactions on Programming Languages and Systems, 12(1):26–61.
Karakostas, V. 1992. Intelligent search and acquisition of business knowledge from programs. Journal of Software Maintenance: Research and Practice, 4:1–17.
Korel, B. and Laski, J. 1988. Dynamic program slicing. Information Processing Letters, 29(3):155–163.
Kort, J., Lämmel, R., and Visser, J. 2000. Functional transformation systems. In 9th International Workshop on Functional and Logic Programming (WFLP'2000), Benicassim, Spain. Online proceedings at http://www.dsic.upv.es/~wflp2000/.
Kumar, S. and Horwitz, S. 2002. Better slicing of programs with jumps and switches. In Proceedings of the 5th International Conference on Fundamental Approaches to Software Engineering (FASE 2002), vol. 2306 of Lecture Notes in Computer Science, Springer, pp. 96–112.
Larsen, L.D. and Harrold, M.J. 1996. Slicing object-oriented software. In Proceedings of the 18th International Conference on Software Engineering, Berlin, pp. 495–505.
Liang, D. and Harrold, M.J. 1998. Slicing objects using the system dependence graph. In IEEE International Conference of Software Maintenance, Bethesda, MD, USA, pp. 358–367. Los Alamitos, CA, USA: IEEE Computer Society Press.
Liao, S.-W., Diwan, A., Bosch, R.P. Jr., Ohuloum, A., and Lam, M.S. 1999. SUIF explorer: An interactive and interprocedural parallelizer. In A. Andrew Chien and Marc Snir, editors, Proceedings of the 1999 ACM Sigplan Symposium on Principles and Practise of Parallel Programming (PPoPP'99), vol. 34.8 of ACM Sigplan Notices, pp. 37–48. A.Y., ACM Press.
Lyle, J.R. and Binkley, D.W. 1993. Program slicing in the presence of pointers. In Foundations of Software Engineering, Orlando, FL, USA, pp. 255–260.
Harrold, M.J. et al. 2002. The aristotle analysis tool.
Maslov, V. 1994. Lazy array data-flow dependence analysis. In, editor, Conference Record of POPL '94, 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages: Papers Presented at the Symposium, Portland, Oregon. New York, NY, USA: ACM Press, pp. 311–325.
Mehlich, M. and Baxter, I. 1997. Mechanical tool support for high integrity software development. In High Integrity Systems '97. Los Alamitos, California, USA: IEEE Computer Society Press.
Norris, C. and Pollock, L.L. 1998. The design and implementation of RAP: A PDG-based register allocator. Software Practice and Experience, 28(4):401–424.
Ottenstein, K.J. and Ottenstein, L.M. 1984. The program dependence graph in software development environments. SIGPLAN Notices, 19(5):177–184.
Ouarbya, L., Danicic, S., Daoudi, D. (Mohd.), Harman, M., and Fox, C. 2002. A denotational interprocedural program slicer. In IEEE Working Conference on Reverse Engineering (WCRE 2002), pp. 181–189, Richmond, Virginia, USA, IEEE Computer Society Press, Los Alamitos, CA, USA.
Partsch, H.A. 1990. The Specification and Transformation of Programs: A Formal Approach to Software Development. Springer.
Paulin-Mohring, C. and Werner, B. 1993. Synthesis of ML programs in the system Coq. Journal of Symbolic Computation, 15(5/6):607–640.
Ramshaw, L. 1988. Eliminating goto's while preserving program structure. Journal of the ACM, 35(4):893–920.
Ryan, C. and Walsh, P. 1997. The evolution of provable parallel programs. In J.R. Koza, K. Deb, M. Dorigo, D.B. Fogel, M. Garzon, H. Iba, and R.L. Riolo, editors, Genetic Programming 1997: Proceedings of the Second Annual Conference, Stanford University, CA, USA. pp. 295–302, Morgan Kaufmann.
Sinha, S. and Harrold, M.J. 1998. Analysis of programs with exception handling constructs. In International Conference on Software Maintenance, pp. 348–357. Los Alamitos, CA, USA: IEEE Computer Society Press.
Sinha, S., Harrold, M.J., and Rothermel, G. 1999. System-dependence-graph-based slicing of programs with arbitrary interprocedural control-flow. In Proceedings of the 21st International Conference on Software Engineering, pp. 432–441. ACM Press.
Stoy, J.E. Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. 3rd edition. MIT Press, 1985.
Tip, F. 1995. Generation of program analysis tools. PhD thesis, Centrum voor Wiskunde en Informatica, Amsterdam.
Tip, F. 1995. A survey of program slicing techniques. Journal of Programming Languages, 3(3):121–189.
Venkatesh, G.A. 1991. The semantic approach to program slicing. In ACM SIGPLAN Conference on Programming Language Design and Implementation, Toronto, Canada, pp. 26–28, 1991. Proceedings in SIGPLAN Notices, 26 (6): 107-119.
Ward, M. 1989. Proving program refinements and transformations. DPhil Thesis, Oxford University
Ward, M. 1994. Reverse engineering through formal transformation. The Computer Journal, 37(5):795–813.
Ward, M. 2001. The formal approach to source code analysis and manipulation. In 1st IEEE International Workshop on Source Code Analysis and Manipulation, pp. 185–193. Florence, Italy. Los Alamitos, CA, USA: IEEE Computer Society Press.
Ward, M. 2002. Program slicing via FermaT transformations. In 26th IEEE Annual Computer Software and Applications Conference (COMPSAC 2002), Oxford, UK, pp. 357–362. Los Alamitos, CA, USA: IEEE Computer Society Press.
Weiser, M. 1979. Program slices: Formal, psychological, and practical investigations of an automatic program abstraction method. PhD thesis, University of Michigan, Ann Arbor, MI.
Weiser, M. 1984. Program slicing. IEEE Transactions on Software Engineering, 10(4): 352–357.
Williams, K.P. 1998. Evolutionary algorithms for automatic parallelization. PhD thesis, University of Reading, UK, Department of Computer Science.
Zhang, X., Munro, M., Harman, M., and Hu, L. 2002a. Mechanized operational semantics of WSL. In IEEE International Workshop on Source Code Analysis and Manipulation (SCAM 2002), Montreal, Canada. pp. 73–82. Los Alamitos, CA, USA: IEEE Computer Society Press.
Zhang, X., Munro, M., Harman, M., and Hu, L. 2002b. Weakest precondition for general recursive programs formalized in Coq. In 15th International Conference on Theorem Proving in Higher Order Logics (TPHOLs 2002), Hampton, Virginia, USA, pp. 332–348. Springer Verlag. LNCS 2410.
Zhao, J. 2002. Slicing aspect-oriented software. In 10th IEEE InternationalWorkshop on ProgramComprehension, Paris, France, pp. 251–260. Los Alamitos, CA, USA: IEEE Computer Society Press.
