This article investigates students' perception of the Chat Generative Pretrained Transformer (ChatGPT)'s effectiveness in undergraduate writing courses. Two research questions were addressed: 1) How do students perceive ChatGPT's effectiveness in English writing? 2) How can ChatGPT contribute to their writing improvement? The study was conducted at the Mediterranean Institute of Technology (MedTech) in Tunis, Tunisia, during the summer of 2023, comprising 21 female and 29 male participants enrolled in English writing courses across various engineering programs. Data collection was carried out through a questionnaire, designed to gather qualitative and quantitative insights, including a combination of open-ended and 5-scale Likert questions. The survey assessed students' perceptions of ChatGPT's effectiveness in various writing aspects and gathered their suggestions for improvement. The results reveal that students find ChatGPT particularly effective in generating ideas and improving grammar. Students appreciate the immediate feedback and suggestions provided by ChatGPT, helping them identify their errors. Additionally, students benefit from ChatGPT's ability to expand their vocabulary and improve writing fluency. However, students also identified areas where ChatGPT could be improved, such as better understanding contextual nuances and providing more reliable and contextually appropriate suggestions. Students emphasized the importance of balancing ChatGPT's use as a writing aid with the development of their own critical thinking and creativity in the writing process. These findings contribute to the ongoing development and implementation of artificial intelligence (AI)-based writing tools, highlighting the importance of balancing technology assistance with students' independent writing abilities and critical thinking.