{'fraction_non_alphanumeric': 0.020506634499396863, 'fraction_numerical': 0.0, 'mean_word_length': 5.2406015037593985, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Analysis and Transformation Program Slicing and Sliding for Refactoring

Slicing is an approach to divide a program into chunks that share a common property, like their contribution to the result of a calculation. Slicing can be used to leverage the power of refactoring tools by providing a deeper understanding of the code. For example, the Extract Method refactoring used to extract a series of statements can—with the aid of a slicing algorithm—be enhanced to allow the extraction of non-contiguous statements. This paper summarizes Ran Ettinger’s thesis about “Refactoring via Program Slicing and Sliding”, where he introduces the notion of sliding, a visualization of the slicing procedure based on transparent overhead-projector slides. I also show how several well-known refactorings can benefit from a slicing algorithm.