This paper adopts a cognitive psychology perspective to investigate the recurring mistakes in code resulting from the mental set (Einstellung) effect. The Einstellung effect is the tendency to approach problem-solving with a preconceived mindset, often overlooking better solutions that may be available. This effect can significantly impact creative thinking, as the development of patterns of thought can hinder the emergence of novel and creative ideas. Our study aims to test the Einstellung effect and the two mechanisms of its overcoming in the field of programming. The first intervention was the change of the color scheme of the code editor to the less habitual one. The second intervention was a combination of instruction to "forget the previous solutions and tasks" and the change in the color scheme. During the experiment, participants were given two sets of four programming tasks. Each task had two possible solutions: one using suboptimal code dictated by the mental set, and the other using a less familiar but more efficient and recommended methodology. Between the sets, participants either received no treatment or one of two interventions aimed at helping them overcome the mental set. The results of our experiment suggest that the tested techniques were insufficient to support overcoming the mental set, which we attribute to the specificity of the programming domain. The study contributes to the existing literature by providing insights into creativity support during problem-solving in software development and offering a framework for experimental research in this field.
翻译:本文从认知心理学视角出发,探讨由心理定势(Einstellung效应)导致的代码重复性错误。Einstellung效应指在解决问题时倾向于采用先入为主的思维定势,常常忽略可能存在的更优解决方案。该效应会显著影响创造性思维,因为思维模式的发展可能阻碍新颖和创新思想的产生。本研究旨在测试编程领域中的Einstellung效应及其两种克服机制。第一种干预措施是将代码编辑器的配色方案改为非常用色调;第二种干预措施则是结合"忘记先前解决方案与任务"的指令与配色方案变更。实验过程中,参与者需完成两组共四项编程任务。每项任务均存在两种解决方案:一种基于心理定势的次优代码,另一种采用虽不常用但更高效且更推荐的方法。两组任务之间,参与者要么不接受任何处理,要么接受旨在帮助他们克服心理定势的两种干预措施之一。实验结果表明,所测试的技术不足以支持克服心理定势,我们将其归因于编程领域的特殊性。本研究通过揭示软件开发问题解决过程中的创造力支持机制,为现有文献做出贡献,并为该领域的实验研究提供框架。