Software programming is a complex task. To help the user with this task, we are developing a case-based reasoning tool capable of suggesting code to the programmer (software reuse). But, due to the dimension and complexity of software programs, acquisition of the case library is a hard task in this domain. In this paper, we show how a software program can be automatically converted into a case, which are described at a functional and behavioural level. The conversion rules presented here have been developed for procedural languages and enable conversion of basic language constructs into functional and behavioural knowledge. We also show some experimental results. 1 This work was partially funded by the Portuguese Ministery of Science and Technology under program PRAXIS XXI